diff --git a/BUGS b/BUGS index 0c36803..9e4c5a0 100644 --- a/BUGS +++ b/BUGS @@ -2,20 +2,22 @@ This file lists the major bugs from the Nagios Plugins page on Sourceforge at http://sourceforge.net/tracker/?group_id=29880&atid=397597. These are not necessarily verified as errors. -For the 1.4.11 release: +For the 1.4.13 release: +2075933 - check_disk segfault on freebsd 7 if using -p option +1985263 - check_ups doesn't disconnect cleanly +1984255 - check_swap not built on Solaris 10 and HP-UX 11.11, 11.23 +1984240 - check_tcp Segmentation fault on HP-UX 11.23 1939578 - check_jabber: Always returns WARNING with Openfire server 1939529 - check_tcp: Expiring SSL certs produce confusing messages -1928399 - check_porcs METRIC_CPU should ignore kernel processes on FreeBSD +1928399 - check_procs METRIC_CPU should ignore kernel processes on FreeBSD 1922579 - check_ldap: ldap_init implicitly converted 1904965 - check_apt: SECURITY_RE is not correct 1894850 - check_ping: incorrectly parses ping6 output 1868822 - check_http link fails with openssl installed -1867716 - check_snmp invalid performance data 1864404 - check_smtp/check_http miscalculate timezones in cert expiry 1681516 - output too verbose for various checks 1670261 - check_snmp might require snmpget with LD_LIBRARY_PATH -1569488 - check_ifoperstatus.pl: -n option does't work (help required!) 1523748 - check_disk should error if warn range is subset of critical 1478287 - check_dns fails with CNAMEs 1469468 - signal handler in popen.c is broken diff --git a/ChangeLog b/ChangeLog index 3939972..97944cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,312 @@ +2008-09-25 08:04 tonvoon + + * [r2056] plugins/tests/check_http.t: + Fix small test failure + +2008-09-25 08:01 tonvoon + + * [r2055] doc/LEAVERS, doc/NEW_STARTERS, doc/RELEASING: + Moving project administration documents to nagiosplugins.org site + +2008-09-02 12:28 dermoth + + * [r2054] plugins/check_ntp_peer.c: + Typo + +2008-09-02 11:26 hweiss + + * [r2053] THANKS.in, plugins/check_http.c: + Some HTTP server applications/configurations cause trouble if the + port is explicitly specified in our "Host:" header line. + Therefore, we now specify the port only if we're using a + non-default port (Erik Wasser - 2082501). + +2008-09-02 03:42 dermoth + + * [r2052] NEWS, plugins/check_ntp_peer.c: + Fix possible segfault in check_ntp_peer with deliberately invalid + packets + +2008-09-01 14:04 dermoth + + * [r2051] NEWS, plugins/check_ntp_peer.c, plugins/check_ntp_time.c: + check_ntp_peer/check_ntp_time used to show port in --help but + ignored the argument - now implemented. + +2008-09-01 14:04 dermoth + + * [r2050] NEWS, THANKS.in, plugins/check_http.c: + Revert "Re-structure the HTTP 1.1 headers to prevent 301s on + servers with virtual hosts" + + This reverts commit 2030 + +2008-09-01 12:20 hweiss + + * [r2049] plugins/check_http.c: + Under some circumstances, the 'url' path of a redirection target + missed a leading slash. While this was fixed later on, the + incomplete 'url' was used for redirection loop detection and + error messages. This is now fixed by adding the missing slash + immediately. + +2008-08-25 18:39 tonvoon + + * [r2048] plugins/tests/check_http.t: + Fix HTTP::Daemon::VERSION to get a fixed header size for tests + (Sven Nierlein) + +2008-08-25 13:26 tonvoon + + * [r2047] plugins/tests/check_http.t: + Updated with more tests re: multiple status codes (Sven Nierlein) + +2008-08-25 11:42 hweiss + + * [r2046] NEWS, THANKS.in, plugins/check_http.c, + plugins/tests/check_http.t: + The "-e" option now accepts a comma-delimited list of expected + status lines (Sven Nierlein - 1894496). + +2008-08-22 13:08 tonvoon + + * [r2045] plugins/tests/check_http.t, plugins/tests/var/root: + Added HTTP tests for status codes + +2008-08-21 21:52 tonvoon + + * [r2044] configure.in: + Only include extra-opts tests if libtap is enabled + +2008-08-21 15:21 tonvoon + + * [r2043] NEWS: + Note re: --enable-libtap + +2008-08-21 15:18 tonvoon + + * [r2042] lib/tests/Makefile.am, lib/tests/test_all.t, + lib/tests/test_base64.t, lib/tests/test_cmd.t, + lib/tests/test_disk.t, lib/tests/test_ini.t, + lib/tests/test_opts.t, lib/tests/test_tcp.t, + lib/tests/test_utils.c, lib/tests/test_utils.t: + Correctly link to included libtap. Simplify invoking test + scripts. Removed basename test as we should use base_name from + GNUlib which is tested separately + +2008-08-21 15:15 tonvoon + + * [r2041] tools/tinderbox_build: + Fix regexp of version number of snapshot + +2008-08-21 15:12 tonvoon + + * [r2040] Makefile.am: + Remove .svn files in distribution + +2008-08-21 15:12 tonvoon + + * [r2039] external/tap-1.01-altinity.tar.gz, + external/tap-1.01-nagios-plugins.tar.gz, tools/setup: + Renamed altered tap file to nagios-plugins + +2008-08-21 09:41 dermoth + + * [r2038] plugins/check_ntp_peer.c: + Nothing + +2008-08-21 04:22 dermoth + + * [r2037] plugins/check_ntp_peer.c: + Misplaced comment + +2008-08-21 04:17 dermoth + + * [r2036] plugins/check_ntp_peer.c: + Complete rewrite of the extract_value function + + The original one was flawed (easy to trigger segfaults) and did + not allow some whitespaces as permitted by rfc1305. This one has + been troughfully tested with tap (the testing code might get + included later) + +2008-08-21 04:17 dermoth + + * [r2035] lib/parse_ini.c, lib/parse_ini.h, lib/tests/test_opts.c: + Typos in comments + +2008-08-16 04:47 dermoth + + * [r2034] plugins/check_mysql.c, plugins/check_mysql_query.c: + Fix assignment written as a comparison in validate_arguments() + when db_pass is NULL (Patch from + http://blog.barfoo.org/projects/rpms-for-sles10) + +2008-08-16 04:47 dermoth + + * [r2033] plugins/check_fping.c: + Fix check_fping --help output (Patch from + http://blog.barfoo.org/projects/rpms-for-sles10) + +2008-08-16 01:52 dermoth + + * [r2032] plugins/t/check_by_ssh.t: + Typo + +2008-08-08 16:12 tonvoon + + * [r2031] plugins-root/pst3.c: + Close on fd + +2008-08-08 02:25 dermoth + + * [r2030] NEWS, THANKS.in, plugins/check_http.c: + Re-structure the HTTP 1.1 headers to prevent 301s on servers with + virtual hosts + +2008-08-08 02:08 dermoth + + * [r2029] plugins-root/check_icmp.c: + Typo in --help output + +2008-08-05 11:14 dermoth + + * [r2028] tools/devmode: + Set -D_FORTIFY_SOURCE=2, and added a comment with link to + explaination of this flag. + +2008-07-28 20:15 psychotrahe + + * [r2027] plugins-root/check_icmp.c: + -b option now specifies ICMP data bytes instead of packet size + +2008-07-17 07:06 psychotrahe + + * [r2026] NEWS, plugins-root/check_icmp.c: + Add support for packet size modification (-b) + +2008-07-10 10:03 dermoth + + * [r2025] plugins/check_disk.c: + Verbose should not have to exceed 3 as per developement + guidelines + +2008-07-10 10:03 dermoth + + * [r2024] tools/devmode: + Add -D_FORTIFY_SOURCE + +2008-07-10 10:03 dermoth + + * [r2023] plugins/check_ups.c: + Typo in check_ups + +2008-07-09 21:54 psychotrahe + + * [r2022] plugins/t/check_snmp.t: + rewrote check_snmp.t to use Test::More added perfdata checking + for string values + +2008-07-09 21:53 psychotrahe + + * [r2021] NEWS, plugins/check_snmp.c: + check_snmp now only prints perfdata for non numeric values (Joerg + Linge #1867716) + +2008-07-08 10:09 tonvoon + + * [r2020] Makefile.am, tools/tinderbox_build: + Removed libtap configuration for the moment, as tinderbox builds + are breaking + +2008-07-08 09:31 tonvoon + + * [r2019] NEWS, lib/utils_cmd.c, lib/utils_cmd.h, + plugins/Makefile.am, plugins/check_procs.c: + check_procs captures stderr and adds to plugin output. This is + from a merge of branch nagiosplug/branches/new_threshold_syntax + 1979:1982 + +2008-07-06 12:57 hweiss + + * [r2018] plugins-root/check_dhcp.c: + Don't try to set the "SO_BROADCAST" socket option for unicast + requests. (Also, removed the unused "DHCP_UNICAST_FLAG" macro.) + +2008-07-02 20:07 tonvoon + + * [r2017] lib/tests/Makefile.am: + Use tap.h from the libtap directory + +2008-07-02 20:00 tonvoon + + * [r2016] plugins-root/Makefile.am, plugins-root/pst3.c: + Change pst3 again, this time to remove use of kvm which is not + available in Solaris 10 non-global zones. Uses /proc, which is + not available in older versions of Solaris. + +2008-06-30 14:32 tonvoon + + * [r2015] tools/setup: + Fixed bug in tools/setup if docbook was run + +2008-06-30 09:01 tonvoon + + * [r2014] Makefile.am: + Have to list tap_dir manually to get into make dist + +2008-06-26 22:00 tonvoon + + * [r2013] Makefile.am, configure.in, external, external/README, + external/tap-1.01-altinity.tar.gz, lib/tests/Makefile.am, + tools/setup, tools/tinderbox_build: + Adding libtap into distribution to help run C based tests + +2008-06-17 14:19 tonvoon + + * [r2012] plugins-root/pst3.c: + Fixed possible coredump. Removed one level of subroutines (Duncan + Ferguson) + +2008-06-09 19:47 psychotrahe + + * [r2011] NEWS, plugins/check_dig.c, plugins/t/check_dig.t: + Added testcases for check_dig check_dig's -l option is mandatory + now (#1986306) + +2008-06-02 16:22 tonvoon + + * [r2010] NEWS, plugins-root/pst3.c: + Optimised pst3 for systems with large number of processes (Duncan + Ferguson) + +2008-06-02 16:21 tonvoon + + * [r2009] NEWS, perlmods/Nagios-Plugin-0.22.tar.gz, + perlmods/Nagios-Plugin-0.27.tar.gz: + Updated Nagios::Plugin perl modules to 0.27 + +2008-05-30 23:38 dermoth + + * [r2008] NEWS, THANKS.in, plugins/check_http.c: + Fix Debian bug #460097: check_http --max-age broken (Hilko + Bengen) + +2008-05-29 10:21 dermoth + + * [r2007] BUGS: + typo + +2008-05-27 23:44 tonvoon + + * [r2006] doc/RELEASING: + Changed SF file release to use sftp instead of ftp + +2008-05-27 22:01 tonvoon + + * [r2004] BUGS, ChangeLog, NEWS, configure.in, package.def: + Preparation for 1.4.12 release + 2008-05-27 21:52 tonvoon * [r2003] THANKS.in, configure.in: @@ -1395,7 +1704,7 @@ 2007-07-07 11:54 psychotrahe * [r1750] plugins-scripts/check_file_age.pl: - substituted $ID$ through $Revision: 2004 $ in print_revision call + substituted $ID$ through $Revision: 2057 $ in print_revision call 2007-07-07 11:40 psychotrahe @@ -4762,8 +5071,7 @@ 2005-04-04 18:24 tonvoon - * [r1155] nagiosplug/branches/r1_4-patches/plugins/check_smtp.c, - plugins/check_smtp.c: + * [r1155] plugins/check_smtp.c: Fix static buffer (Nikolay Sturm) 2005-03-18 03:14 mattkent @@ -6506,8 +6814,7 @@ 2004-03-18 20:40 tonvoon - * [r852] nagiosplug/branches/release-1.3.0/configure.in, - configure.in: + * [r852] configure.in: Mysql include path not added correctly (Arnold Cavazos - 912974) 2004-03-18 20:31 tonvoon @@ -6689,14 +6996,8 @@ 2004-02-20 05:25 kdebisschop - * [r818] nagiosplug/branches/release-1.3.0/contrib/check_dhcp.c, - nagiosplug/branches/release-1.3.0/contrib/check_procl.sh, - nagiosplug/branches/release-1.3.0/plugins/check_snmp.c, - nagiosplug/branches/release-1.3.0/plugins/negate.c, - nagiosplug/branches/release-1.3.0/plugins/netutils.c, - nagiosplug/branches/release-1.3.0/plugins/urlize.c, - contrib/check_dhcp.c, plugins/check_snmp.c, plugins/negate.c, - plugins/netutils.c, plugins/urlize.c: + * [r818] contrib/check_dhcp.c, plugins/check_snmp.c, + plugins/negate.c, plugins/netutils.c, plugins/urlize.c: spell fix "received" 2004-02-20 05:21 kdebisschop @@ -6807,14 +7108,13 @@ 2004-01-21 12:50 kdebisschop - * [r797] nagiosplug/branches/release-1.3.0/AUTHORS, AUTHORS: + * [r797] AUTHORS: credit David Croft (patch check_tcp formultibyte malloc bug in server_expect) 2004-01-21 12:49 kdebisschop - * [r796] nagiosplug/branches/release-1.3.0/plugins/check_tcp.c, - plugins/check_tcp.c: + * [r796] plugins/check_tcp.c: =fix segfault on malloc of server_expect for multibyte chars (David Croft) @@ -7384,8 +7684,7 @@ 2003-08-22 04:43 kdebisschop - * [r689] nagiosplug/branches/release-1.3.0/plugins/check_http.c, - plugins/check_http.c: + * [r689] plugins/check_http.c: * bugfix: snprintf of timestamp truncated '\0' 2003-08-21 18:00 kdebisschop @@ -7765,8 +8064,7 @@ 2003-08-01 02:12 kdebisschop - * [r624] nagiosplug/branches/release-1.3.0/plugins/Makefile.am, - plugins/Makefile.am: + * [r624] plugins/Makefile.am: 'ln -f -s ...' is not reliable/portable. Use 'rm -f ...; ln -s ...' @@ -7831,14 +8129,12 @@ 2003-07-29 03:06 kdebisschop - * [r613] nagiosplug/branches/release-1.3.0/configure.in, - configure.in: + * [r613] configure.in: look for getloadavg.c in $topdir/lib, not $srcdir/lib 2003-07-29 03:05 kdebisschop - * [r612] nagiosplug/branches/release-1.3.0/plugins/check_http.c, - plugins/check_http.c: + * [r612] plugins/check_http.c: patch attempt to reference undefined optarg (credit Paul Farrall) 2003-07-28 11:36 tonvoon @@ -7974,9 +8270,7 @@ 2003-07-02 16:21 tonvoon - * [r581] - nagiosplug/branches/release-1.3.0/plugins-scripts/check_oracle.sh, - plugins-scripts/check_oracle.sh: + * [r581] plugins-scripts/check_oracle.sh: Check for ORA- errors for tablespace and cache (patch 755456 - Sven Meyer) @@ -8145,14 +8439,12 @@ 2003-06-12 04:46 undrgrid - * [r548] nagiosplug/branches/release-1.3.0/command.cfg.in, - command.cfg.in: + * [r548] command.cfg.in: Renamed duplicate check_snmp command definitions to be unique 2003-06-12 04:16 undrgrid - * [r547] nagiosplug/branches/release-1.3.0/command.cfg.in, - command.cfg.in, configure.in: + * [r547] command.cfg.in, configure.in: Made the two check_ifoperstatus commands unique to remove conflicts @@ -8202,8 +8494,7 @@ 2003-06-02 14:46 kdebisschop - * [r531] nagiosplug/branches/release-1.3.0/plugins/check_tcp.c, - plugins/check_tcp.c: + * [r531] plugins/check_tcp.c: finish recv() loop when stream GT or EQ maxbytes (was GT) 2003-06-01 05:38 kdebisschop @@ -8231,26 +8522,22 @@ 2003-05-17 23:10 tonvoon - * [r521] nagiosplug/branches/release-1.3.0/plugins/t/check_ftp.t, - plugins/t/check_ftp.t: + * [r521] plugins/t/check_ftp.t: Fixed test (Mathew Ericson - 738609) 2003-05-17 17:59 tonvoon - * [r520] nagiosplug/branches/release-1.3.0/plugins/t/check_load.t, - plugins/t/check_load.t: + * [r520] plugins/t/check_load.t: Fixed tests (Mathew Ericson - 738607) 2003-05-17 17:50 tonvoon - * [r519] nagiosplug/branches/release-1.3.0/plugins/t/check_procs.t, - plugins/t/check_procs.t: + * [r519] plugins/t/check_procs.t: Fixed test commands (Mathew Ericson - 738605) 2003-05-17 17:40 tonvoon - * [r518] nagiosplug/branches/release-1.3.0/plugins/t/check_http.t, - plugins/t/check_http.t: + * [r518] plugins/t/check_http.t: Fixed tests (Mathew Ericson - 738608) 2003-05-17 17:36 tonvoon @@ -8261,9 +8548,7 @@ 2003-05-16 17:33 sghosh - * [r515] - nagiosplug/branches/release-1.3.0/plugins-scripts/check_ntp.pl, - plugins-scripts/check_ntp.pl: + * [r515] plugins-scripts/check_ntp.pl: bug fix 2003-05-14 23:17 tonvoon @@ -8332,8 +8617,7 @@ 2003-05-09 03:00 kdebisschop - * [r501] nagiosplug/branches/release-1.3.0/plugins/check_snmp.c, - plugins/check_snmp.c: + * [r501] plugins/check_snmp.c: cause snmpget try try for 1 second less than the timeout (allowing plugin to force close if needed) @@ -8349,16 +8633,12 @@ 2003-04-25 09:07 sghosh - * [r499] - nagiosplug/branches/release-1.3.0/plugins-scripts/check_ntp.pl, - plugins-scripts/check_ntp.pl: + * [r499] plugins-scripts/check_ntp.pl: corrected output units 2003-04-23 04:58 kdebisschop - * [r498] nagiosplug/branches/release-1.3.0/plugins/check_http.c, - nagiosplug/branches/release-1.3.0/plugins/utils.c, - plugins/check_http.c: + * [r498] plugins/check_http.c: update to RFC1123 hostname specs 2003-04-17 05:56 kdebisschop @@ -8573,8 +8853,7 @@ 2003-03-24 00:42 tonvoon - * [r452] nagiosplug/branches/release-1.3.0/REQUIREMENTS, - REQUIREMENTS: + * [r452] REQUIREMENTS: Add NSClient requirement for check_nt 2003-03-24 00:26 tonvoon @@ -8684,9 +8963,7 @@ 2003-03-17 22:24 tonvoon - * [r428] - nagiosplug/branches/release-1.3.0/plugins-scripts/check_oracle.sh, - plugins-scripts/check_oracle.sh: + * [r428] plugins-scripts/check_oracle.sh: Allow default Oracle home from oratab (reported by Walbert Oberngruber) @@ -8872,8 +9149,7 @@ 2003-03-11 22:34 tonvoon - * [r397] nagiosplug/branches/release-1.3.0/plugins/negate.c, - plugins/negate.c: + * [r397] plugins/negate.c: Fixed reading too many argv parameters and changed to asprintf 2003-03-11 22:22 tonvoon @@ -8936,14 +9212,12 @@ 2003-03-09 10:39 tonvoon - * [r388] nagiosplug/branches/release-1.3.0/plugins/check_disk.c, - plugins/check_disk.c: + * [r388] plugins/check_disk.c: Implement error-only option for check_disk (Ian Duggan) 2003-03-08 12:08 tonvoon - * [r387] nagiosplug/branches/release-1.3.0/plugins/check_disk.c, - plugins/check_disk.c: + * [r387] plugins/check_disk.c: Fix AIX /proc filesystem (Ian Duggan) 2003-03-08 11:44 tonvoon @@ -9004,8 +9278,7 @@ 2003-03-08 00:23 tonvoon - * [r377] nagiosplug/branches/release-1.3.0/Makefile.am, - Makefile.am: + * [r377] Makefile.am: Use Makefile's variables (to support a shortcut in sfsnapshot) 2003-03-07 22:11 undrgrid @@ -9027,14 +9300,12 @@ 2003-03-07 07:17 kdebisschop - * [r373] nagiosplug/branches/release-1.3.0/plugins/check_smtp.c, - plugins/check_smtp.c: + * [r373] plugins/check_smtp.c: whole timer loop was on the wrong side of connection close code 2003-03-07 06:43 kdebisschop - * [r372] nagiosplug/branches/release-1.3.0/plugins/check_udp.c, - plugins/check_udp.c: + * [r372] plugins/check_udp.c: fix for -H invocation of hostname 2003-03-06 06:40 undrgrid @@ -11067,9 +11338,6 @@ 2002-02-28 06:42 - * [r1] Nagios-Plugin, Nagios-Plugin/branches, Nagios-Plugin/tags, - Nagios-Plugin/trunk, nagiosmib, nagiosmib/branches, - nagiosmib/tags, nagiosmib/trunk, nagiosplug, nagiosplug/branches, - nagiosplug/tags, .: + * [r1] .: New repository initialized by cvs2svn. diff --git a/Makefile.am b/Makefile.am index 416ef62..b6e5f2e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,10 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = gl lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@ +SUBDIRS = gl tap lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@ EXTRA_DIST = config.rpath \ ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS BUGS CODING FAQ LEGAL NEWS \ - REQUIREMENTS SUPPORT THANKS \ + NP-VERSION-GEN REQUIREMENTS SUPPORT THANKS \ NPTest.pm contrib pkg nagios-plugins.spec \ config_test/Makefile config_test/run_tests config_test/child_test.c \ perlmods tools/build_perl_modules \ @@ -17,7 +17,7 @@ DEFS = -DLOCALEDIR=\"$(localedir)\" dist-hook: make THANKS nagios-plugins.spec pkg/fedora/nagios-plugins.spec - rm -rf `find $(distdir) -name CVS` + echo ${VERSION} >$(distdir)/release install-root: cd plugins-root && $(MAKE) $@ @@ -57,3 +57,4 @@ THANKS: THANKS.in pkgclean: rm -rf $(BUILDDIR) $(PACKDIR) + diff --git a/Makefile.in b/Makefile.in index d229bf7..426f634 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46,17 +46,19 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ - $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ - $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \ - $(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \ - $(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \ + $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \ + $(top_srcdir)/gl/m4/dos.m4 \ $(top_srcdir)/gl/m4/double-slash-root.m4 \ - $(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \ + $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \ $(top_srcdir)/gl/m4/exitfail.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-safer.m4 \ - $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \ + $(top_srcdir)/gl/m4/floorf.m4 \ $(top_srcdir)/gl/m4/fstypename.m4 \ $(top_srcdir)/gl/m4/fsusage.m4 \ $(top_srcdir)/gl/m4/getaddrinfo.m4 \ @@ -66,7 +68,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/glibc21.m4 \ $(top_srcdir)/gl/m4/gnulib-common.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ - $(top_srcdir)/gl/m4/iconv.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/iconv.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \ $(top_srcdir)/gl/m4/intlmacosx.m4 \ @@ -75,17 +77,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \ $(top_srcdir)/gl/m4/lib-prefix.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/longlong.m4 \ $(top_srcdir)/gl/m4/ls-mntd-fs.m4 \ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \ $(top_srcdir)/gl/m4/mountlist.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/nls.m4 \ - $(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \ + $(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \ $(top_srcdir)/gl/m4/safe-read.m4 \ $(top_srcdir)/gl/m4/safe-write.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \ $(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \ @@ -95,13 +104,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \ $(top_srcdir)/gl/m4/strnlen.m4 \ $(top_srcdir)/gl/m4/sys_socket_h.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/unistd-safer.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/vasnprintf.m4 \ $(top_srcdir)/gl/m4/vasprintf.m4 \ $(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \ - $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \ - $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \ + $(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ + $(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -140,6 +152,7 @@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ @@ -170,16 +183,24 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +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@ F77 = @F77@ +FCNTL_H = @FCNTL_H@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ @@ -188,47 +209,85 @@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPL = @GNULIB_FREXPL@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -238,18 +297,37 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_ROUND = @GNULIB_ROUND@ GNULIB_ROUNDF = @GNULIB_ROUNDF@ GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ @@ -262,32 +340,57 @@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ 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_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ @@ -300,25 +403,46 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_OS_H = @HAVE_OS_H@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ @@ -332,8 +456,16 @@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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@ @@ -341,14 +473,20 @@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +HOSTENT_LIB = @HOSTENT_LIB@ HOSTNAME = @HOSTNAME@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -370,6 +508,10 @@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -382,15 +524,21 @@ MYSQLCFLAGS = @MYSQLCFLAGS@ MYSQLINCLUDE = @MYSQLINCLUDE@ MYSQLLIBS = @MYSQLLIBS@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_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@ @@ -432,16 +580,23 @@ PKG_ARCH = @PKG_ARCH@ PLUGIN_TEST = @PLUGIN_TEST@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PST3CFLAGS = @PST3CFLAGS@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ PYTHON = @PYTHON@ RADIUSLIBS = @RADIUSLIBS@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ +RELEASE_PRESENT_FALSE = @RELEASE_PRESENT_FALSE@ +RELEASE_PRESENT_TRUE = @RELEASE_PRESENT_TRUE@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -457,12 +612,28 @@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ +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_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -472,19 +643,32 @@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ 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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ REV_DATESTAMP = @REV_DATESTAMP@ REV_TIMESTAMP = @REV_TIMESTAMP@ SCRIPT_TEST = @SCRIPT_TEST@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ @@ -498,6 +682,11 @@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_LIBTAP_LOCAL_FALSE = @USE_LIBTAP_LOCAL_FALSE@ +USE_LIBTAP_LOCAL_TRUE = @USE_LIBTAP_LOCAL_TRUE@ USE_NLS = @USE_NLS@ USE_PARSE_INI_FALSE = @USE_PARSE_INI_FALSE@ USE_PARSE_INI_TRUE = @USE_PARSE_INI_TRUE@ @@ -565,10 +754,10 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ with_trusted_path = @with_trusted_path@ -SUBDIRS = gl lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@ +SUBDIRS = gl tap lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@ EXTRA_DIST = config.rpath \ ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS BUGS CODING FAQ LEGAL NEWS \ - REQUIREMENTS SUPPORT THANKS \ + NP-VERSION-GEN REQUIREMENTS SUPPORT THANKS \ NPTest.pm contrib pkg nagios-plugins.spec \ config_test/Makefile config_test/run_tests config_test/child_test.c \ perlmods tools/build_perl_modules \ @@ -1027,7 +1216,7 @@ uninstall-info: uninstall-info-recursive dist-hook: make THANKS nagios-plugins.spec pkg/fedora/nagios-plugins.spec - rm -rf `find $(distdir) -name CVS` + echo ${VERSION} >$(distdir)/release install-root: cd plugins-root && $(MAKE) $@ diff --git a/NEWS b/NEWS index 3f1fece..451b654 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,61 @@ This file documents the major additions and syntax changes between releases. +1.4.14 ... + 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 (sf.net #1569488) + check_ifoperstatus now supports ifType based lookup for ifIndex + check_ups now sends a LOGOUT string (debian bug #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 (Steve Rader) + Fixed check_http bug where additional headers with redirection caused a segfault (Dieter Van de Walle - 2089159) + check_disk: make autofs mount paths specified with -p before we determine the mount list (Erik Welch) + 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 (bug #2378068) + Fixed check_http behaviour: all check are now performed as long as a valid response is returned (sf.net #1460312) + check_http --onredirect=sticky follows using the same IP address (sf.net #2550208) + check_http --onredirect=stickyport also follows the same port + Fixed coredump from check_nt when invalid drive is specified (#2179754 - Olli Hauer) + Fixed crash from check_nt when -H unspecified or given multiple times (sf.net #2731755, debian #521097) + Fixed passing of quotes in OID for check_snmp (#1985230 - Jan Wagner, patch by John Barbuto) + 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 - Oskar Ahner) + check_nt can return UNKNOWN on timeouts (-u) + Fixed typos for check_disk (Chris Pepper) + Fixed check_mysql* not using password set in my.cnf (#2531905 - Ben Timby) - Specify an empty password explicitly if you need to override it. + Fixed awk subst.in/subst script path error (#2722832 - Martin Foster) + check_http: Add SSL/TLS hostname extension support (SNI) - (#1939022 - Joe Presbrey) + Fixed wrong perfdata label for output traffic in check_mrtgtraf (#2654308 - Gavin Williams) + 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 - Martin Foster) + Fixed SNMPv3 behaviour of check_ifoperstatus and check_ifstatus. Added -P to define privprotocol (#2343438 - Robin Schroeder) + check_ifoperstatus and check_ifstatus are now more user-friendly in case of missing arguments + +1.4.13 25th Sept 2008 + Fix Debian bug #460097: check_http --max-age broken (Hilko Bengen) + Optimised pst3 for systems with large number of processes (Duncan Ferguson) + Updated Nagios::Plugin to 0.27 + Fix Debian bug #479013: check_dig's -l is mandatory now (sf.net #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 (Sven Nierlein) + 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 (Alessandro Ren) New check_icmp -s option to specify the source IP address diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN new file mode 100755 index 0000000..657ef3c --- /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=1.4.13.git + +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 index ef49c64..54a535e 100644 --- a/NPTest.pm +++ b/NPTest.pm @@ -21,7 +21,7 @@ use Data::Dumper; use Test; use vars qw($VERSION); -$VERSION = do { my @r = (q$Revision: 1556 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker +$VERSION = "1556."; # must be all one line, for MakeMaker =head1 NAME @@ -625,10 +625,10 @@ sub testCmd { chomp $output; $object->output($output); + my ($pkg, $file, $line) = caller(0); + print "Testing: $command", $/; if ($ENV{'NPTEST_DEBUG'}) { - my ($pkg, $file, $line) = caller(0); print "testCmd: Called from line $line in $file", $/; - print "Testing: $command", $/; print "Output: ", $object->output, $/; print "Return code: ", $object->return_code, $/; } diff --git a/THANKS b/THANKS index 9d3e18b..69b6faf 100644 --- a/THANKS +++ b/THANKS @@ -5,6 +5,7 @@ raising bug reports, creating patches or contributing new plugins. dag rob?le fabiodds Randy O'Meara +Oskar Ahner Lance Albertson David Alden Rodger Allen @@ -20,11 +21,13 @@ Markus Baertschi Bradley Baetz Michael Bakker Nobuhiro Ban +John Barbuto Jeremy Baumgartner Andreas Behal Lutz Behnke Marlo Bell Simon Bellwood +Hilko Bengen Allan Bennett Guy Van Den Bergh Tom Bertelston @@ -81,6 +84,7 @@ James Fidell Johan Fischer Bernhard Fischer Matthias Flacke +Martin Foster Felix Frank Rick Frey Matt Garrett @@ -98,23 +102,27 @@ Jon Hallett Steve Hanselman Ask Bjoern Hansen Michael Haro +Olli Hauer Gunnar Hellekson Johannes Herlitz Ian Holsman Peter Hoogendijk Jason Hoos +Richard Edward Horner Chester Hosey Bob Ingraham Cire Iriarte Valdimir Ivaschenko Harald Jenny Mark Jewiss +Nikita Kalabukhov Frank Kannemann Roy Sigurd Karlsbakk Jason Kau Bo Kersey Serhan Kiymaz Denis Knauf +Tilman Koschnick John Koyle Steven Kreuzer Christoph Kron @@ -125,6 +133,7 @@ Gerhard Lausser Lynne Lawrence Sakari Lehtonen Pedro Leite +Jan Lipphaus Larry Low Jacob Lundqvist Guenther Mair @@ -153,12 +162,14 @@ Jan-Frode Myklebust Sivakumar Nellurandi Truongchinh Nguyen Simon L Nielsen +Sven Nierlein Thomas Nilsen Walbert Oberngruber Craig Orsinger Remi Paulmier Tom Payerle Fabian Pehla +Chris Pepper Matt Perry Matthew Peters William Pietri @@ -168,8 +179,12 @@ Ari Pollak Marc Poulin Matt Pounsett Peter Pramberger +Joe Presbrey +Will Preston Arnaud Quette Darian Rackham +Steve Rader +Olivier 'Babar' Raginel Phil Randal Abid Rasheed Jeremy Reed @@ -204,12 +219,14 @@ Tom Shields Sean Shore Antony Simmonds John Sivak +Nik Soggia Lars Stavholm Nikolay Sturm David Sullivan Kjell Sundtjonn Ziya Suzen Michael Tiernan +Ben Timby Ronald Tin Ibere Tizio Julien Touche @@ -225,10 +242,13 @@ Robert August Vincent Dave Viner Nathan Vonnahme Jan Wagner +Dieter Van de Walle John Warburton Christian G Warden +Erik Wasser Stuart Webster Holger Weiss +Erik Welch Torsten Werner Ben Whaley Adrian Wieczorek diff --git a/acinclude.m4 b/acinclude.m4 index c1b4219..acee3e1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -8,7 +8,6 @@ dnl e.g. 6 arguments (linux) dnl e.g. 5 arguments (solaris) dnl e.g. 3 arguments (osf/1) dnl -dnl @version $Id: acinclude.m4 805 2004-02-18 14:56:39Z kdebisschop $ dnl @author Brian Stafford dnl dnl based on version by Caolan McNamara diff --git a/aclocal.m4 b/aclocal.m4 index 0e7d641..3c0ee44 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -7258,20 +7258,23 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/np_mysqlclient.m4]) +m4_include([gl/m4/00gnulib.m4]) m4_include([gl/m4/alloca.m4]) m4_include([gl/m4/arpa_inet_h.m4]) m4_include([gl/m4/base64.m4]) +m4_include([gl/m4/btowc.m4]) m4_include([gl/m4/c-strtod.m4]) m4_include([gl/m4/cloexec.m4]) m4_include([gl/m4/codeset.m4]) m4_include([gl/m4/dirname.m4]) m4_include([gl/m4/dos.m4]) m4_include([gl/m4/double-slash-root.m4]) -m4_include([gl/m4/eoverflow.m4]) +m4_include([gl/m4/errno_h.m4]) m4_include([gl/m4/error.m4]) m4_include([gl/m4/exitfail.m4]) m4_include([gl/m4/extensions.m4]) m4_include([gl/m4/fcntl-safer.m4]) +m4_include([gl/m4/fcntl_h.m4]) m4_include([gl/m4/float_h.m4]) m4_include([gl/m4/floorf.m4]) m4_include([gl/m4/fstypename.m4]) @@ -7284,6 +7287,7 @@ m4_include([gl/m4/gettext.m4]) m4_include([gl/m4/glibc21.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/iconv.m4]) m4_include([gl/m4/include_next.m4]) m4_include([gl/m4/inet_ntop.m4]) @@ -7295,20 +7299,31 @@ m4_include([gl/m4/lib-ld.m4]) m4_include([gl/m4/lib-link.m4]) m4_include([gl/m4/lib-prefix.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/longlong.m4]) m4_include([gl/m4/ls-mntd-fs.m4]) m4_include([gl/m4/malloc.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/mktime.m4]) m4_include([gl/m4/mountlist.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/nls.m4]) -m4_include([gl/m4/onceonly_2_57.m4]) +m4_include([gl/m4/onceonly.m4]) +m4_include([gl/m4/open.m4]) m4_include([gl/m4/po.m4]) +m4_include([gl/m4/printf.m4]) m4_include([gl/m4/progtest.m4]) m4_include([gl/m4/regex.m4]) m4_include([gl/m4/safe-read.m4]) m4_include([gl/m4/safe-write.m4]) +m4_include([gl/m4/servent.m4]) m4_include([gl/m4/size_max.m4]) m4_include([gl/m4/snprintf.m4]) m4_include([gl/m4/socklen.m4]) @@ -7325,6 +7340,9 @@ m4_include([gl/m4/string_h.m4]) m4_include([gl/m4/strndup.m4]) m4_include([gl/m4/strnlen.m4]) m4_include([gl/m4/sys_socket_h.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/unistd-safer.m4]) m4_include([gl/m4/unistd_h.m4]) m4_include([gl/m4/vasnprintf.m4]) @@ -7332,8 +7350,10 @@ m4_include([gl/m4/vasprintf.m4]) m4_include([gl/m4/vsnprintf.m4]) m4_include([gl/m4/wchar.m4]) m4_include([gl/m4/wchar_t.m4]) +m4_include([gl/m4/wcrtomb.m4]) m4_include([gl/m4/wctype.m4]) m4_include([gl/m4/wint_t.m4]) +m4_include([gl/m4/write.m4]) m4_include([gl/m4/xalloc.m4]) m4_include([gl/m4/xsize.m4]) m4_include([gl/m4/xstrndup.m4]) diff --git a/build-aux/config.rpath b/build-aux/config.rpath index 35f959b..85c2f20 100755 --- a/build-aux/config.rpath +++ b/build-aux/config.rpath @@ -47,7 +47,7 @@ for cc_temp in $CC""; do done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` -# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. +# Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then @@ -64,7 +64,7 @@ else ;; esac ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' @@ -76,7 +76,13 @@ else ;; linux* | k*bsd*-gnu) case $cc_basename in - icc* | ecc*) + ecc*) + wl='-Wl,' + ;; + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) @@ -124,7 +130,7 @@ else esac fi -# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= @@ -132,7 +138,7 @@ hardcode_direct=no hardcode_minus_L=no case "$host_os" in - cygwin* | mingw* | pw32*) + 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++. @@ -182,7 +188,7 @@ if test "$with_gnu_ld" = yes; then ld_shlibs=no fi ;; - cygwin* | mingw* | pw32*) + 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' @@ -326,7 +332,7 @@ else ;; bsdi[45]*) ;; - cygwin* | mingw* | pw32*) + 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 @@ -494,7 +500,7 @@ else fi # Check dynamic linker characteristics -# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +# 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 @@ -517,7 +523,7 @@ case "$host_os" in bsdi[45]*) library_names_spec='$libname$shrext' ;; - cygwin* | mingw* | pw32*) + cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; diff --git a/command.cfg.in b/command.cfg.in index 6a9e151..aff33d2 100644 --- a/command.cfg.in +++ b/command.cfg.in @@ -1,8 +1,6 @@ ############################################################################### # COMMAND CONFIGURATION # -# $Id: command.cfg.in 973 2004-12-02 04:48:37Z mattkent $ -# # SYNTAX: # command[]= # diff --git a/config.h.in b/config.h.in index 032d0c2..a480836 100644 --- a/config.h.in +++ b/config.h.in @@ -1,5 +1,9 @@ /* config.h.in. Generated from configure.in by autoheader. */ +/* Define if the compiler is building for multiple architectures of Apple + platforms at once. */ +#undef AA_APPLE_UNIVERSAL_BUILD + /* Define to the number of bits in type 'ptrdiff_t'. */ #undef BITSIZEOF_PTRDIFF_T @@ -45,9 +49,6 @@ language is requested. */ #undef ENABLE_NLS -/* Define as good substitute value for EOVERFLOW. */ -#undef EOVERFLOW - /* Define on systems for which file names may have a so-called `drive letter' prefix, define this to compute the length of that prefix, including the colon. */ @@ -71,6 +72,12 @@ /* Define to indicate the 'malloc' module. */ #undef GNULIB_MALLOC_GNU +/* Define to 1 when using the gnulib module open. */ +#undef GNULIB_OPEN + +/* Define to 1 if you have the `alarm' function. */ +#undef HAVE_ALARM + /* Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution. */ #undef HAVE_ALLOCA @@ -82,6 +89,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H +/* Define to 1 if you have the `btowc' function. */ +#undef HAVE_BTOWC + /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT @@ -168,6 +178,10 @@ don't. */ #undef HAVE_DECL_SYSCONF +/* Define to 1 if you have the declaration of `timegm', and to 0 if you don't. + */ +#undef HAVE_DECL_TIMEGM + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #undef HAVE_DECL_VSNPRINTF @@ -188,6 +202,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ERR_H +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + /* Define to 1 if you have the header file. */ #undef HAVE_FEATURES_H @@ -224,6 +241,9 @@ /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY +/* 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 @@ -239,9 +259,6 @@ /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV -/* Define if your compiler supports the #include_next directive. */ -#undef HAVE_INCLUDE_NEXT - /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP @@ -305,6 +322,9 @@ /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBINTL_H + /* Define to 1 if you have the `kstat' library (-lkstat). */ #undef HAVE_LIBKSTAT @@ -320,6 +340,9 @@ /* Define to 1 if you have the 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 `radiusclient' library (-lradiusclient). */ #undef HAVE_LIBRADIUSCLIENT @@ -352,6 +375,9 @@ /* 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 declares mbstate_t. */ #undef HAVE_MBSTATE_T @@ -418,12 +444,18 @@ /* Define to 1 if you have the `pstat_getdynamic' function. */ #undef HAVE_PSTAT_GETDYNAMIC +/* Define to 1 if you have the header file. */ +#undef HAVE_RANDOM_H + /* Define to 1 if you have the header file. */ #undef HAVE_RSA_H /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT +/* Define to 1 if you have the `shutdown' function. */ +#undef HAVE_SHUTDOWN + /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H @@ -482,6 +514,9 @@ /* Define if you have the strndup() function and it works. */ #undef HAVE_STRNDUP +/* Define to 1 if you have the `strnlen' function. */ +#undef HAVE_STRNLEN + /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR @@ -500,6 +535,15 @@ /* Define to 1 if `n_un.n_name' is member of `struct nlist'. */ #undef HAVE_STRUCT_NLIST_N_UN_N_NAME +/* Define to 1 if the system has the type `struct random_data'. */ +#undef HAVE_STRUCT_RANDOM_DATA + +/* Define to 1 if `sa_len' is 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 `f_fstypename' is member of `struct statfs'. */ #undef HAVE_STRUCT_STATFS_F_FSTYPENAME @@ -539,6 +583,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_INTTYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_LOADAVG_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MNTENT_H @@ -590,6 +637,12 @@ /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H +/* Define to 1 if you have the `timegm' function. */ +#undef HAVE_TIMEGM + +/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H + /* Define to 1 if you have the header file. */ #undef HAVE_UIO_H @@ -629,6 +682,9 @@ /* 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 header file. */ #undef HAVE_WCTYPE_H @@ -638,6 +694,12 @@ /* 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 header file. */ #undef HAVE_WS2TCPIP_H @@ -656,6 +718,15 @@ # define ISSLASH(C) ((C) == '/') #endif +/* Define if the mbrtowc function has the NULL string argument bug. */ +#undef MBRTOWC_NULL_ARG_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 there is no specific function for reading the list of mounted file systems. fread will be used to read /etc/mnttab. (SVR2) */ #undef MOUNTED_FREAD @@ -721,6 +792,9 @@ /* path and args for nslookup */ #undef NSLOOKUP_COMMAND +/* Define to 1 if open() fails to recognize a trailing slash. */ +#undef OPEN_TRAILING_SLASH_BUG + /* Name of package */ #undef PACKAGE @@ -956,6 +1030,9 @@ /* Define if you want regoff_t to be at least as wide POSIX requires. */ #undef _REGEX_LARGE_OFFSETS +/* Define to 500 only on HP-UX. */ +#undef _XOPEN_SOURCE + /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE @@ -1006,12 +1083,25 @@ /* Define to long or long long if and 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 MacOS 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 rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to a type if does not define. */ #undef mbstate_t +/* Define to rpl_mktime if the replacement function should be used. */ +#undef mktime + /* Define to `int' if does not define. */ #undef pid_t @@ -1088,3 +1178,13 @@ /* Define to rpl_strnlen if the replacement function should be used. */ #undef strnlen + +/* Define as a marker that can be attached to function parameter declarations + for parameters that are not used. This helps to reduce warnings, such as + from GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) +#else +# define _UNUSED_PARAMETER_ +#endif + diff --git a/configure b/configure index b1188cf..0980c6c 100755 --- a/configure +++ b/configure @@ -1,7 +1,6 @@ #! /bin/sh -# From configure.in . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for nagios-plugins 1.4.12. +# Generated by GNU Autoconf 2.61 for nagios-plugins 1.4.13. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -727,8 +726,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='nagios-plugins' PACKAGE_TARNAME='nagios-plugins' -PACKAGE_VERSION='1.4.12' -PACKAGE_STRING='nagios-plugins 1.4.12' +PACKAGE_VERSION='1.4.13' +PACKAGE_STRING='nagios-plugins 1.4.13' PACKAGE_BUGREPORT='' ac_unique_file="NPTest.pm" @@ -884,6 +883,8 @@ with_trusted_path PKG_ARCH REV_DATESTAMP REV_TIMESTAMP +RELEASE_PRESENT_TRUE +RELEASE_PRESENT_FALSE PYTHON SH PERL @@ -892,6 +893,8 @@ HOSTNAME BASENAME SOCKETLIBS MATHLIBS +USE_LIBTAP_LOCAL_TRUE +USE_LIBTAP_LOCAL_FALSE EXTRA_TEST USE_PARSE_INI_TRUE USE_PARSE_INI_FALSE @@ -957,8 +960,64 @@ GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE ALLOCA ALLOCA_H +GNULIB_INET_NTOP +GNULIB_INET_PTON +HAVE_DECL_INET_NTOP +HAVE_DECL_INET_PTON ARPA_INET_H +HAVE_ARPA_INET_H INCLUDE_NEXT +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +PRAGMA_SYSTEM_HEADER +NEXT_ARPA_INET_H +GNULIB_BTOWC +GNULIB_WCTOB +GNULIB_MBSINIT +GNULIB_MBRTOWC +GNULIB_MBRLEN +GNULIB_MBSRTOWCS +GNULIB_MBSNRTOWCS +GNULIB_WCRTOMB +GNULIB_WCSRTOMBS +GNULIB_WCSNRTOMBS +GNULIB_WCWIDTH +HAVE_BTOWC +HAVE_MBSINIT +HAVE_MBRTOWC +HAVE_MBRLEN +HAVE_MBSRTOWCS +HAVE_MBSNRTOWCS +HAVE_WCRTOMB +HAVE_WCSRTOMBS +HAVE_WCSNRTOMBS +HAVE_DECL_WCTOB +HAVE_DECL_WCWIDTH +REPLACE_MBSTATE_T +REPLACE_BTOWC +REPLACE_WCTOB +REPLACE_MBSINIT +REPLACE_MBRTOWC +REPLACE_MBRLEN +REPLACE_MBSRTOWCS +REPLACE_MBSNRTOWCS +REPLACE_WCRTOMB +REPLACE_WCSRTOMBS +REPLACE_WCSNRTOMBS +REPLACE_WCWIDTH +WCHAR_H +LOCALE_FR +NEXT_ERRNO_H +ERRNO_H +EMULTIHOP_HIDDEN +EMULTIHOP_VALUE +ENOLINK_HIDDEN +ENOLINK_VALUE +EOVERFLOW_HIDDEN +EOVERFLOW_VALUE +GNULIB_OPEN +REPLACE_OPEN +NEXT_FCNTL_H +FCNTL_H NEXT_FLOAT_H FLOAT_H GNULIB_CEILF @@ -968,6 +1027,11 @@ GNULIB_FLOORL GNULIB_FREXP GNULIB_FREXPL GNULIB_ISFINITE +GNULIB_ISINF +GNULIB_ISNAN +GNULIB_ISNANF +GNULIB_ISNAND +GNULIB_ISNANL GNULIB_LDEXPL GNULIB_MATHL GNULIB_ROUND @@ -977,6 +1041,9 @@ GNULIB_SIGNBIT GNULIB_TRUNC GNULIB_TRUNCF GNULIB_TRUNCL +HAVE_ISNANF +HAVE_ISNAND +HAVE_ISNANL HAVE_DECL_ACOSL HAVE_DECL_ASINL HAVE_DECL_ATANL @@ -990,64 +1057,171 @@ HAVE_DECL_SQRTL HAVE_DECL_TANL HAVE_DECL_TRUNC HAVE_DECL_TRUNCF -HAVE_DECL_TRUNCL REPLACE_CEILF REPLACE_CEILL REPLACE_FLOORF REPLACE_FLOORL REPLACE_FREXP REPLACE_FREXPL +REPLACE_HUGE_VAL REPLACE_ISFINITE +REPLACE_ISINF +REPLACE_ISNAN REPLACE_LDEXPL +REPLACE_NAN REPLACE_ROUND REPLACE_ROUNDF REPLACE_ROUNDL REPLACE_SIGNBIT REPLACE_SIGNBIT_USING_GCC +REPLACE_TRUNCL FLOORF_LIBM +GNULIB_SOCKET +GNULIB_CONNECT +GNULIB_ACCEPT +GNULIB_BIND +GNULIB_GETPEERNAME +GNULIB_GETSOCKNAME +GNULIB_GETSOCKOPT +GNULIB_LISTEN +GNULIB_RECV +GNULIB_SEND +GNULIB_RECVFROM +GNULIB_SENDTO +GNULIB_SETSOCKOPT +GNULIB_SHUTDOWN +HAVE_STRUCT_SOCKADDR_STORAGE NEXT_SYS_SOCKET_H HAVE_SYS_SOCKET_H -HAVE_WINSOCK2_H HAVE_WS2TCPIP_H +GNULIB_CHOWN +GNULIB_CLOSE +GNULIB_DUP2 +GNULIB_ENVIRON +GNULIB_EUIDACCESS +GNULIB_FCHDIR +GNULIB_FSYNC +GNULIB_FTRUNCATE +GNULIB_GETCWD +GNULIB_GETDOMAINNAME +GNULIB_GETDTABLESIZE +GNULIB_GETHOSTNAME +GNULIB_GETLOGIN_R +GNULIB_GETPAGESIZE +GNULIB_GETUSERSHELL +GNULIB_LCHOWN +GNULIB_LINK +GNULIB_LSEEK +GNULIB_READLINK +GNULIB_SLEEP +GNULIB_UNISTD_H_SIGPIPE +GNULIB_WRITE +HAVE_DUP2 +HAVE_EUIDACCESS +HAVE_FSYNC +HAVE_FTRUNCATE +HAVE_GETDOMAINNAME +HAVE_GETDTABLESIZE +HAVE_GETHOSTNAME +HAVE_GETPAGESIZE +HAVE_GETUSERSHELL +HAVE_LINK +HAVE_READLINK +HAVE_SLEEP +HAVE_DECL_ENVIRON +HAVE_DECL_GETLOGIN_R +HAVE_OS_H +HAVE_SYS_PARAM_H +REPLACE_CHOWN +REPLACE_CLOSE +REPLACE_FCHDIR +REPLACE_GETCWD +REPLACE_GETPAGESIZE +REPLACE_LCHOWN +REPLACE_LSEEK +REPLACE_WRITE +UNISTD_H_HAVE_WINSOCK2_H +HAVE_WINSOCK2_H SYS_SOCKET_H +GNULIB_GETADDRINFO +HAVE_STRUCT_ADDRINFO +HAVE_DECL_FREEADDRINFO +HAVE_DECL_GAI_STRERROR +HAVE_DECL_GETADDRINFO +HAVE_DECL_GETNAMEINFO +NEXT_NETDB_H +HAVE_NETDB_H +NETDB_H +HOSTENT_LIB +SERVENT_LIB +GETADDRINFO_LIB +GNULIB_MALLOC_POSIX +GNULIB_REALLOC_POSIX +GNULIB_CALLOC_POSIX +GNULIB_ATOLL +GNULIB_GETLOADAVG +GNULIB_GETSUBOPT +GNULIB_MKDTEMP +GNULIB_MKSTEMP +GNULIB_PUTENV +GNULIB_RANDOM_R +GNULIB_RPMATCH +GNULIB_SETENV +GNULIB_STRTOD +GNULIB_STRTOLL +GNULIB_STRTOULL +GNULIB_UNSETENV +HAVE_ATOLL +HAVE_CALLOC_POSIX +HAVE_GETSUBOPT +HAVE_MALLOC_POSIX +HAVE_MKDTEMP +HAVE_REALLOC_POSIX +HAVE_RANDOM_R +HAVE_RPMATCH +HAVE_SETENV +HAVE_STRTOD +HAVE_STRTOLL +HAVE_STRTOULL +HAVE_STRUCT_RANDOM_DATA +HAVE_SYS_LOADAVG_H +HAVE_UNSETENV +HAVE_DECL_GETLOADAVG +REPLACE_MKSTEMP +REPLACE_PUTENV +REPLACE_STRTOD +VOID_UNSETENV NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS GETOPT_H GLIBC21 LOCALCHARSET_TESTS_ENVIRONMENT -HAVE_MALLOC_POSIX -GNULIB_MALLOC_POSIX -GNULIB_REALLOC_POSIX -GNULIB_CALLOC_POSIX -GNULIB_GETSUBOPT -GNULIB_MKDTEMP -GNULIB_MKSTEMP -GNULIB_PUTENV -GNULIB_SETENV -GNULIB_UNSETENV -HAVE_CALLOC_POSIX -HAVE_GETSUBOPT -HAVE_MKDTEMP -HAVE_REALLOC_POSIX -HAVE_SETENV -HAVE_UNSETENV -REPLACE_MKSTEMP -REPLACE_PUTENV -VOID_UNSETENV NEXT_MATH_H +LOCALE_JA +LOCALE_ZH_CN +LOCALE_FR_UTF8 +APPLE_UNIVERSAL_BUILD NEXT_NETINET_IN_H HAVE_NETINET_IN_H NETINET_IN_H +GNULIB_FPRINTF GNULIB_FPRINTF_POSIX +GNULIB_PRINTF GNULIB_PRINTF_POSIX GNULIB_SNPRINTF GNULIB_SPRINTF_POSIX +GNULIB_VFPRINTF GNULIB_VFPRINTF_POSIX +GNULIB_VPRINTF GNULIB_VPRINTF_POSIX GNULIB_VSNPRINTF GNULIB_VSPRINTF_POSIX +GNULIB_DPRINTF +GNULIB_VDPRINTF GNULIB_VASPRINTF +GNULIB_OBSTACK_PRINTF +GNULIB_OBSTACK_PRINTF_POSIX GNULIB_FOPEN GNULIB_FREOPEN GNULIB_FSEEK @@ -1055,8 +1229,18 @@ GNULIB_FSEEKO GNULIB_FTELL GNULIB_FTELLO GNULIB_FFLUSH +GNULIB_FCLOSE +GNULIB_FPUTC +GNULIB_PUTC +GNULIB_PUTCHAR +GNULIB_FPUTS +GNULIB_PUTS +GNULIB_FWRITE GNULIB_GETDELIM GNULIB_GETLINE +GNULIB_PERROR +GNULIB_STDIO_H_SIGPIPE +REPLACE_STDIO_WRITE_FUNCS REPLACE_FPRINTF REPLACE_VFPRINTF REPLACE_PRINTF @@ -1067,8 +1251,14 @@ REPLACE_VSNPRINTF HAVE_DECL_VSNPRINTF REPLACE_SPRINTF REPLACE_VSPRINTF +HAVE_DPRINTF +REPLACE_DPRINTF +HAVE_VDPRINTF +REPLACE_VDPRINTF HAVE_VASPRINTF REPLACE_VASPRINTF +HAVE_DECL_OBSTACK_PRINTF +REPLACE_OBSTACK_PRINTF REPLACE_FOPEN REPLACE_FREOPEN HAVE_FSEEKO @@ -1078,9 +1268,11 @@ HAVE_FTELLO REPLACE_FTELLO REPLACE_FTELL REPLACE_FFLUSH +REPLACE_FCLOSE HAVE_DECL_GETDELIM HAVE_DECL_GETLINE REPLACE_GETLINE +REPLACE_PERROR STDBOOL_H HAVE__BOOL HAVE_LONG_LONG_INT @@ -1092,24 +1284,26 @@ HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T -BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T +BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX -SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX +SIG_ATOMIC_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STDIO_H NEXT_STDLIB_H +HAVE_RANDOM_H GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR +GNULIB_RAWMEMCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL @@ -1137,9 +1331,11 @@ GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL +GNULIB_STRVERSCMP HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR +HAVE_RAWMEMCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL @@ -1153,51 +1349,31 @@ HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL +HAVE_STRVERSCMP +REPLACE_MEMMEM +REPLACE_STRDUP +REPLACE_STRSTR +REPLACE_STRCASESTR REPLACE_STRERROR REPLACE_STRSIGNAL -REPLACE_MEMMEM -REPLACE_STRCASESTR -REPLACE_STRSTR NEXT_STRING_H -GNULIB_CHOWN -GNULIB_DUP2 -GNULIB_FCHDIR -GNULIB_FTRUNCATE -GNULIB_GETCWD -GNULIB_GETLOGIN_R -GNULIB_GETPAGESIZE -GNULIB_LCHOWN -GNULIB_LSEEK -GNULIB_READLINK -GNULIB_SLEEP -HAVE_DUP2 -HAVE_FTRUNCATE -HAVE_GETPAGESIZE -HAVE_READLINK -HAVE_SLEEP -HAVE_DECL_GETLOGIN_R -HAVE_OS_H -HAVE_SYS_PARAM_H -REPLACE_CHOWN -REPLACE_FCHDIR -REPLACE_GETCWD -REPLACE_GETPAGESIZE -REPLACE_LCHOWN -REPLACE_LSEEK +REPLACE_LOCALTIME_R +REPLACE_NANOSLEEP +REPLACE_STRPTIME +REPLACE_TIMEGM +NEXT_TIME_H +TIME_H_DEFINES_STRUCT_TIMESPEC +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC NEXT_UNISTD_H HAVE_UNISTD_H -EOVERFLOW -GNULIB_WCWIDTH -HAVE_DECL_WCWIDTH -REPLACE_WCWIDTH -WCHAR_H +HAVE_WINT_T HAVE_WCHAR_H NEXT_WCHAR_H HAVE_ISWCNTRL -HAVE_WINT_T NEXT_WCTYPE_H HAVE_WCTYPE_H WCTYPE_H +REPLACE_ISWCNTRL LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS LTLIBOBJS @@ -1723,7 +1899,7 @@ 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 nagios-plugins 1.4.12 to adapt to many kinds of systems. +\`configure' configures nagios-plugins 1.4.13 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1793,7 +1969,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of nagios-plugins 1.4.12:";; + short | recursive ) echo "Configuration of nagios-plugins 1.4.13:";; esac cat <<\_ACEOF @@ -1808,6 +1984,8 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files + --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 @@ -1863,12 +2041,9 @@ Optional Packages: --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 --without-included-regex - don't compile regex; this is the default on 32-bit - systems with recent-enough versions of the GNU C - Library (use with caution on other systems). On - systems with 64-bit ptrdiff_t and 32-bit int, - --with-included-regex is the default, in case regex - functions operate on very long strings (>2GB) + 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 @@ -1948,7 +2123,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -nagios-plugins configure 1.4.12 +nagios-plugins configure 1.4.13 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1962,7 +2137,7 @@ 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 nagios-plugins $as_me 1.4.12, which was +It was created by nagios-plugins $as_me 1.4.13, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2237,6 +2412,9 @@ fi gt_needs="$gt_needs need-ngettext" gl_header_list="$gl_header_list arpa/inet.h" +gl_func_list="$gl_func_list btowc" +gl_header_list="$gl_header_list errno.h" +gl_header_list="$gl_header_list fcntl.h" gl_header_list="$gl_header_list float.h" gl_header_list="$gl_header_list sys/param.h" gl_header_list="$gl_header_list sys/vfs.h" @@ -2245,21 +2423,25 @@ gl_header_list="$gl_header_list sys/socket.h" gl_header_list="$gl_header_list netdb.h" gl_header_list="$gl_header_list netinet/in.h" gl_header_list="$gl_header_list math.h" +gl_func_list="$gl_func_list mbsinit" +gl_func_list="$gl_func_list mbrtowc" +gl_header_list="$gl_header_list unistd.h" +gl_func_list="$gl_func_list alarm" gl_header_list="$gl_header_list sys/statvfs.h" gl_header_list="$gl_header_list locale.h" gl_func_list="$gl_func_list isblank" gl_func_list="$gl_func_list iswctype" -gl_func_list="$gl_func_list mbrtowc" -gl_func_list="$gl_func_list wcrtomb" gl_func_list="$gl_func_list wcscoll" gl_header_list="$gl_header_list stdint.h" gl_header_list="$gl_header_list wchar.h" gl_header_list="$gl_header_list stdio.h" gl_header_list="$gl_header_list stdlib.h" gl_header_list="$gl_header_list string.h" -gl_header_list="$gl_header_list unistd.h" +gl_header_list="$gl_header_list time.h" +gl_header_list="$gl_header_list sys/time.h" gl_func_list="$gl_func_list pipe" gl_func_list="$gl_func_list vasnprintf" +gl_func_list="$gl_func_list wcrtomb" gl_func_list="$gl_func_list iswcntrl" gl_header_list="$gl_header_list wctype.h" # Check that the precious variables saved in the cache have kept the same @@ -2662,7 +2844,7 @@ fi # Define the identity of the package. PACKAGE='nagios-plugins' - VERSION='1.4.12' + VERSION='1.4.13' cat >>confdefs.h <<_ACEOF @@ -4762,6 +4944,8 @@ done + + if test "${ac_cv_header_minix_config_h+set}" = set; then { echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } @@ -4912,6 +5096,16 @@ _ACEOF fi + case "$host_os" in + hpux*) + +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE 500 +_ACEOF + + ;; + esac + { echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 @@ -4993,6 +5187,11 @@ _ACEOF + + + + + if test $ac_cv_c_compiler_gnu = yes; then { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } @@ -5593,7 +5792,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5596 "configure"' > conftest.$ac_ext + echo '#line 5795 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7846,11 +8045,11 @@ else -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:7849: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8048: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7853: \$? = $ac_status" >&5 + echo "$as_me:8052: \$? = $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. @@ -8114,11 +8313,11 @@ else -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:8117: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8316: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8121: \$? = $ac_status" >&5 + echo "$as_me:8320: \$? = $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. @@ -8218,11 +8417,11 @@ else -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:8221: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8420: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8225: \$? = $ac_status" >&5 + echo "$as_me:8424: \$? = $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 @@ -10515,7 +10714,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13153: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12958: \$? = $ac_status" >&5 + echo "$as_me:13157: \$? = $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. @@ -13055,11 +13254,11 @@ else -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:13058: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13257: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13062: \$? = $ac_status" >&5 + echo "$as_me:13261: \$? = $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 @@ -14616,11 +14815,11 @@ else -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:14619: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14818: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14623: \$? = $ac_status" >&5 + echo "$as_me:14822: \$? = $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. @@ -14720,11 +14919,11 @@ else -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:14723: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14922: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14727: \$? = $ac_status" >&5 + echo "$as_me:14926: \$? = $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 @@ -16907,11 +17106,11 @@ else -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:16910: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17109: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16914: \$? = $ac_status" >&5 + echo "$as_me:17113: \$? = $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. @@ -17175,11 +17374,11 @@ else -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:17178: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17377: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17182: \$? = $ac_status" >&5 + echo "$as_me:17381: \$? = $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. @@ -17279,11 +17478,11 @@ else -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:17282: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17481: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17286: \$? = $ac_status" >&5 + echo "$as_me:17485: \$? = $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 @@ -20765,6 +20964,17 @@ REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'` + + +if test -f release; then + RELEASE_PRESENT_TRUE= + RELEASE_PRESENT_FALSE='#' +else + RELEASE_PRESENT_TRUE='#' + RELEASE_PRESENT_FALSE= +fi + + # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -21494,7 +21704,27 @@ fi -{ echo "$as_me:$LINENO: checking for plan_tests in -ltap" >&5 +# 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 + { echo "$as_me:$LINENO: checking for plan_tests in -ltap" >&5 echo $ECHO_N "checking for plan_tests in -ltap... $ECHO_C" >&6; } if test "${ac_cv_lib_tap_plan_tests+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -21556,11 +21786,17 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_lib_tap_plan_tests" >&5 echo "${ECHO_T}$ac_cv_lib_tap_plan_tests" >&6; } if test $ac_cv_lib_tap_plan_tests = yes; then - EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64" - + 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 @@ -21580,13 +21816,15 @@ else fi if test "$enable_extra_opts" = "yes" ; then - EXTRA_TEST="$EXTRA_TEST test_ini test_opts" - cat >>confdefs.h <<\_ACEOF #define NP_EXTRA_OPTS 1 _ACEOF + if test "$enable_libtap" = "yes"; then + EXTRA_TEST="$EXTRA_TEST test_ini1 test_ini3 test_opts1 test_opts2 test_opts3" + + fi fi _SAVEDLIBS="$LIBS" @@ -25077,69 +25315,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for mbstate_t" >&5 -echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6; } -if test "${ac_cv_type_mbstate_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -# include -int -main () -{ -mbstate_t x; return sizeof x; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_mbstate_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_mbstate_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 -echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6; } - if test $ac_cv_type_mbstate_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBSTATE_T 1 -_ACEOF - - else - -cat >>confdefs.h <<\_ACEOF -#define mbstate_t int -_ACEOF - - fi { echo "$as_me:$LINENO: checking for va_copy" >&5 echo $ECHO_N "checking for va_copy... $ECHO_C" >&6; } @@ -28938,23 +29113,74 @@ fi - acl_libdirstem=lib - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; + + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { echo "$as_me:$LINENO: checking for 64-bit host" >&5 +echo $ECHO_N "checking for 64-bit host... $ECHO_C" >&6; } +if test "${gl_cv_solaris_64bit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sixtyfour bits" >/dev/null 2>&1; then + gl_cv_solaris_64bit=yes +else + gl_cv_solaris_64bit=no +fi +rm -f conftest* + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_solaris_64bit" >&5 +echo "${ECHO_T}$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi - done - IFS="$acl_save_IFS" - fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + + + @@ -29000,6 +29226,10 @@ if test "${with_libiconv_prefix+set}" = set; then else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi fi fi @@ -29151,7 +29381,9 @@ 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"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= @@ -29218,7 +29450,16 @@ fi case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBICONV_PREFIX="$basedir" + 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" ;; esac @@ -29267,9 +29508,11 @@ fi case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -29413,6 +29656,11 @@ fi + + + + + @@ -29932,6 +30180,9 @@ echo "${ECHO_T}$LIBICONV" >&6; } + + + use_additional=yes acl_save_prefix="$prefix" @@ -29968,6 +30219,10 @@ if test "${with_libintl_prefix+set}" = set; then else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi fi fi @@ -30119,7 +30374,9 @@ 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"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= @@ -30186,7 +30443,16 @@ fi case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBINTL_PREFIX="$basedir" + 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" ;; esac @@ -30235,9 +30501,11 @@ fi case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -30363,6 +30631,11 @@ fi done fi + + + + + { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } if { as_var=$gt_func_gnugettext_libintl; eval "test \"\${$as_var+set}\" = set"; }; then @@ -30647,6 +30920,89 @@ if test "$enable_perl_modules" = "yes" ; then fi +# From Tap configure +# Checks for libraries +case "$host" in + *-*-*freebsd4*) + LDFLAGS="$LDFLAGS -pthread" + HAVE_LIBPTHREAD=1 + ;; + *) + +{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5 +echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; } +if test "${ac_cv_lib_pthread_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_pthread_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; } +if test $ac_cv_lib_pthread_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +fi + + ;; +esac + + + + + + + + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { echo "$as_me:$LINENO: checking for working alloca.h" >&5 @@ -31011,6 +31367,13 @@ _ACEOF fi + GNULIB_INET_NTOP=0; + GNULIB_INET_PTON=0; + HAVE_DECL_INET_NTOP=1; + HAVE_DECL_INET_PTON=1; + ARPA_INET_H=''; + + @@ -31159,6 +31522,127 @@ done + + + { echo "$as_me:$LINENO: checking whether the preprocessor supports include_next" >&5 +echo $ECHO_N "checking whether the preprocessor supports include_next... $ECHO_C" >&6; } +if test "${gl_cv_have_include_next+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat < conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < 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 >conftest.$ac_ext <<_ACEOF +#include +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_have_include_next=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat >conftest.$ac_ext <<_ACEOF +#include +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_have_include_next=buggy +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 +{ echo "$as_me:$LINENO: result: $gl_cv_have_include_next" >&5 +echo "${ECHO_T}$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 + + + + { echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then @@ -31304,6 +31788,312 @@ _ACEOF esac + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + 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_DECL_WCTOB=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; + WCHAR_H=''; + + + + + + +for ac_func in $gl_func_list +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + + + { echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 +echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; } +if test "${am_cv_langinfo_codeset+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char* cs = nl_langinfo(CODESET); return !cs; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + am_cv_langinfo_codeset=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + am_cv_langinfo_codeset=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 +echo "${ECHO_T}$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LANGINFO_CODESET 1 +_ACEOF + + fi + + + + + { echo "$as_me:$LINENO: checking for a traditional french locale" >&5 +echo $ECHO_N "checking for a traditional french locale... $ECHO_C" >&6; } +if test "${gt_cv_locale_fr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS 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 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; + /* 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; + return 0; +} + +_ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS 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 + fi + rm -fr conftest* + +fi +{ echo "$as_me:$LINENO: result: $gt_cv_locale_fr" >&5 +echo "${ECHO_T}$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + { echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 echo $ECHO_N "checking whether system is Windows or MSDOS... $ECHO_C" >&6; } if test "${ac_cv_win_or_dos+set}" = set; then @@ -31469,8 +32259,8 @@ else gl_cv_double_slash_root='unknown, assuming no' ;; esac else - set x `ls -di / //` - if test $2 = $4 && wc //dev/null >/dev/null 2>&1; then + 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 @@ -31487,6 +32277,1366 @@ _ACEOF fi + + + + + + + + + { echo "$as_me:$LINENO: checking for complete errno.h" >&5 +echo $ECHO_N "checking for complete errno.h... $ECHO_C" >&6; } +if test "${gl_cv_header_errno_h_complete+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#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 ECANCELED +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 +{ echo "$as_me:$LINENO: result: $gl_cv_header_errno_h_complete" >&5 +echo "${ECHO_T}$gl_cv_header_errno_h_complete" >&6; } + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + + + + + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_errno_h='<'errno.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_errno_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/errno.h#{ + s#.*"\(.*/errno.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_errno_h='<'errno.h'>' + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_errno_h" >&5 +echo "${ECHO_T}$gl_cv_next_errno_h" >&6; } + fi + NEXT_ERRNO_H=$gl_cv_next_errno_h + + + + ERRNO_H='errno.h' + fi + + + if test -n "$ERRNO_H"; then + { echo "$as_me:$LINENO: checking for EMULTIHOP value" >&5 +echo $ECHO_N "checking for EMULTIHOP value... $ECHO_C" >&6; } +if test "${gl_cv_header_errno_h_EMULTIHOP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#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 test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EMULTIHOP) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EMULTIHOP) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EMULTIHOP) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EMULTIHOP) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EMULTIHOP) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) gl_cv_header_errno_h_EMULTIHOP=$ac_lo;; +'') ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +static long int longval () { return EMULTIHOP; } +static unsigned long int ulongval () { return EMULTIHOP; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((EMULTIHOP) < 0) + { + long int i = longval (); + if (i != (EMULTIHOP)) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (EMULTIHOP)) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_errno_h_EMULTIHOP=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val + fi + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +echo "${ECHO_T}$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 test -n "$ERRNO_H"; then + { echo "$as_me:$LINENO: checking for ENOLINK value" >&5 +echo $ECHO_N "checking for ENOLINK value... $ECHO_C" >&6; } +if test "${gl_cv_header_errno_h_ENOLINK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#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 test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((ENOLINK) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((ENOLINK) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((ENOLINK) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((ENOLINK) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((ENOLINK) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) gl_cv_header_errno_h_ENOLINK=$ac_lo;; +'') ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +static long int longval () { return ENOLINK; } +static unsigned long int ulongval () { return ENOLINK; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((ENOLINK) < 0) + { + long int i = longval (); + if (i != (ENOLINK)) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (ENOLINK)) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_errno_h_ENOLINK=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val + fi + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_errno_h_ENOLINK" >&5 +echo "${ECHO_T}$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 test -n "$ERRNO_H"; then + { echo "$as_me:$LINENO: checking for EOVERFLOW value" >&5 +echo $ECHO_N "checking for EOVERFLOW value... $ECHO_C" >&6; } +if test "${gl_cv_header_errno_h_EOVERFLOW+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#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 test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EOVERFLOW) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EOVERFLOW) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EOVERFLOW) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +int +main () +{ +static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) gl_cv_header_errno_h_EOVERFLOW=$ac_lo;; +'') ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +static long int longval () { return EOVERFLOW; } +static unsigned long int ulongval () { return EOVERFLOW; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((EOVERFLOW) < 0) + { + long int i = longval (); + if (i != (EOVERFLOW)) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (EOVERFLOW)) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_errno_h_EOVERFLOW=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val + fi + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +echo "${ECHO_T}$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 + + { echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strerror_r+set}" = set; then @@ -31779,78 +33929,13 @@ fi XGETTEXT_EXTRA_OPTIONS= - - { echo "$as_me:$LINENO: checking whether the preprocessor supports include_next" >&5 -echo $ECHO_N "checking whether the preprocessor supports include_next... $ECHO_C" >&6; } -if test "${gl_cv_have_include_next+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - rm -rf conftestd1 conftestd2 - mkdir conftestd1 conftestd2 - cat < conftestd1/conftest.h -#define DEFINED_IN_CONFTESTD1 -#include_next -#ifdef DEFINED_IN_CONFTESTD2 -int foo; -#else -#error "include_next doesn't work" -#endif -EOF - cat < conftestd2/conftest.h -#ifndef DEFINED_IN_CONFTESTD1 -#error "include_next test doesn't work" -#endif -#define DEFINED_IN_CONFTESTD2 -EOF - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" - cat >conftest.$ac_ext <<_ACEOF -#include -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_have_include_next=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_have_include_next=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$save_CPPFLAGS" - rm -rf conftestd1 conftestd2 - -fi -{ echo "$as_me:$LINENO: result: $gl_cv_have_include_next" >&5 -echo "${ECHO_T}$gl_cv_have_include_next" >&6; } - if test $gl_cv_have_include_next = yes; then + GNULIB_OPEN=0; + REPLACE_OPEN=0; + -cat >>confdefs.h <<\_ACEOF -#define HAVE_INCLUDE_NEXT 1 -_ACEOF - INCLUDE_NEXT=include_next - else - INCLUDE_NEXT=include - fi @@ -31867,6 +33952,11 @@ _ACEOF GNULIB_FREXP=0; GNULIB_FREXPL=0; GNULIB_ISFINITE=0; + GNULIB_ISINF=0; + GNULIB_ISNAN=0; + GNULIB_ISNANF=0; + GNULIB_ISNAND=0; + GNULIB_ISNANL=0; GNULIB_LDEXPL=0; GNULIB_MATHL=0; GNULIB_ROUND=0; @@ -31876,7 +33966,10 @@ _ACEOF GNULIB_TRUNC=0; GNULIB_TRUNCF=0; GNULIB_TRUNCL=0; - HAVE_DECL_ACOSL=1; + HAVE_ISNANF=1; + HAVE_ISNAND=1; + HAVE_ISNANL=1; + HAVE_DECL_ACOSL=1; HAVE_DECL_ASINL=1; HAVE_DECL_ATANL=1; HAVE_DECL_COSL=1; @@ -31889,20 +33982,24 @@ _ACEOF HAVE_DECL_TANL=1; HAVE_DECL_TRUNC=1; HAVE_DECL_TRUNCF=1; - HAVE_DECL_TRUNCL=1; REPLACE_CEILF=0; REPLACE_CEILL=0; REPLACE_FLOORF=0; REPLACE_FLOORL=0; REPLACE_FREXP=0; REPLACE_FREXPL=0; + REPLACE_HUGE_VAL=0; REPLACE_ISFINITE=0; + REPLACE_ISINF=0; + REPLACE_ISNAN=0; REPLACE_LDEXPL=0; + REPLACE_NAN=0; REPLACE_ROUND=0; REPLACE_ROUNDF=0; REPLACE_ROUNDL=0; REPLACE_SIGNBIT=0; REPLACE_SIGNBIT_USING_GCC=0; + REPLACE_TRUNCL=0; @@ -31923,12 +34020,81 @@ _ACEOF + GNULIB_SOCKET=0; + GNULIB_CONNECT=0; + GNULIB_ACCEPT=0; + GNULIB_BIND=0; + GNULIB_GETPEERNAME=0; + GNULIB_GETSOCKNAME=0; + GNULIB_GETSOCKOPT=0; + GNULIB_LISTEN=0; + GNULIB_RECV=0; + GNULIB_SEND=0; + GNULIB_RECVFROM=0; + GNULIB_SENDTO=0; + GNULIB_SETSOCKOPT=0; + GNULIB_SHUTDOWN=0; + HAVE_STRUCT_SOCKADDR_STORAGE=1; + + + GNULIB_CHOWN=0; + GNULIB_CLOSE=0; + GNULIB_DUP2=0; + GNULIB_ENVIRON=0; + GNULIB_EUIDACCESS=0; + GNULIB_FCHDIR=0; + GNULIB_FSYNC=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETDOMAINNAME=0; + GNULIB_GETDTABLESIZE=0; + GNULIB_GETHOSTNAME=0; + GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; + GNULIB_GETUSERSHELL=0; + GNULIB_LCHOWN=0; + GNULIB_LINK=0; + GNULIB_LSEEK=0; + GNULIB_READLINK=0; + GNULIB_SLEEP=0; + GNULIB_UNISTD_H_SIGPIPE=0; + GNULIB_WRITE=0; + HAVE_DUP2=1; + HAVE_EUIDACCESS=1; + HAVE_FSYNC=1; + HAVE_FTRUNCATE=1; + HAVE_GETDOMAINNAME=1; + HAVE_GETDTABLESIZE=1; + HAVE_GETHOSTNAME=1; + HAVE_GETPAGESIZE=1; + HAVE_GETUSERSHELL=1; + HAVE_LINK=1; + HAVE_READLINK=1; + HAVE_SLEEP=1; + HAVE_DECL_ENVIRON=1; + HAVE_DECL_GETLOGIN_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; + REPLACE_CHOWN=0; + REPLACE_CLOSE=0; + REPLACE_FCHDIR=0; + REPLACE_GETCWD=0; + REPLACE_GETPAGESIZE=0; + REPLACE_LCHOWN=0; + REPLACE_LSEEK=0; + REPLACE_WRITE=0; + UNISTD_H_HAVE_WINSOCK2_H=0; + + + + + { echo "$as_me:$LINENO: checking whether is self-contained" >&5 echo $ECHO_N "checking whether is self-contained... $ECHO_C" >&6; } if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then @@ -31982,8 +34148,161 @@ fi echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; } if test $gl_cv_header_sys_socket_h_selfcontained = yes; then SYS_SOCKET_H='' + +for ac_func in shutdown +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + if test $ac_cv_func_shutdown = yes; then + { echo "$as_me:$LINENO: checking whether defines the SHUT_* macros" >&5 +echo $ECHO_N "checking whether defines the SHUT_* macros... $ECHO_C" >&6; } +if test "${gl_cv_header_sys_socket_h_shut+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_sys_socket_h_shut=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_header_sys_socket_h_shut=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_shut" >&5 +echo "${ECHO_T}$gl_cv_header_sys_socket_h_shut" >&6; } + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi else SYS_SOCKET_H='sys/socket.h' + fi + # We need to check for ws2tcpip.h now. + @@ -32015,7 +34334,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_sys_socket_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_socket_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/sys/socket.h#{ s#.*"\(.*/sys/socket.h\)".*#\1# s#^/[^/]#//&# @@ -32034,15 +34357,13 @@ echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; } - if test $ac_cv_header_sys_socket_h = yes; then - HAVE_SYS_SOCKET_H=1 - HAVE_WINSOCK2_H=0 - HAVE_WS2TCPIP_H=0 - else - HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 - -for ac_header in winsock2.h ws2tcpip.h +for ac_header in ws2tcpip.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -32181,24 +34502,265 @@ fi done - if test $ac_cv_header_winsock2_h = yes; then - HAVE_WINSOCK2_H=1 - else - HAVE_WINSOCK2_H=0 - fi - if test $ac_cv_header_ws2tcpip_h = yes; then - HAVE_WS2TCPIP_H=1 - else - HAVE_WS2TCPIP_H=0 - fi + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 fi + fi + { echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5 +echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_sockaddr_storage+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* 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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif + + +typedef struct sockaddr_storage ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_struct_sockaddr_storage=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_sockaddr_storage=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_storage" >&5 +echo "${ECHO_T}$ac_cv_type_struct_sockaddr_storage" >&6; } +if test $ac_cv_type_struct_sockaddr_storage = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +_ACEOF + + +fi + + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + SYS_SOCKET_H='sys/socket.h' + fi + if test -n "$SYS_SOCKET_H"; then + + + + + : + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + +for ac_header in winsock2.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 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 + GNULIB_GETADDRINFO=0; + HAVE_STRUCT_ADDRINFO=1; + HAVE_DECL_FREEADDRINFO=1; + HAVE_DECL_GAI_STRERROR=1; + HAVE_DECL_GETADDRINFO=1; + HAVE_DECL_GETNAMEINFO=1; @@ -32212,6 +34774,627 @@ done + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netdb_h='<'netdb.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_netdb_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_netdb_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_netdb_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/netdb.h#{ + s#.*"\(.*/netdb.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_netdb_h='<'netdb.h'>' + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_netdb_h" >&5 +echo "${ECHO_T}$gl_cv_next_netdb_h" >&6; } + fi + NEXT_NETDB_H=$gl_cv_next_netdb_h + + + + if test $ac_cv_header_netdb_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + struct addrinfo a; + int b = EAI_OVERFLOW; + int c = AI_NUMERICSERV; + +int +main () +{ + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + NETDB_H='' +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + NETDB_H='netdb.h' +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + HAVE_NETDB_H=1 + else + NETDB_H='netdb.h' + HAVE_NETDB_H=0 + fi + + + + + HOSTENT_LIB= + gl_saved_libs="$LIBS" + { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 +echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } +if test "${ac_cv_search_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_gethostbyname=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_gethostbyname+set}" = set; then + break +fi +done +if test "${ac_cv_search_gethostbyname+set}" = set; then + : +else + ac_cv_search_gethostbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 +echo "${ECHO_T}$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 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + + { echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5 +echo $ECHO_N "checking for gethostbyname in winsock2.h and -lws2_32... $ECHO_C" >&6; } +if test "${gl_cv_w32_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gl_cv_w32_gethostbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include + +int +main () +{ +gethostbyname(NULL); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gl_cv_w32_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5 +echo "${ECHO_T}$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" + { echo "$as_me:$LINENO: checking for library containing getservbyname" >&5 +echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6; } +if test "${ac_cv_search_getservbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_getservbyname=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_getservbyname+set}" = set; then + break +fi +done +if test "${ac_cv_search_getservbyname+set}" = set; then + : +else + ac_cv_search_getservbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5 +echo "${ECHO_T}$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 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + + { echo "$as_me:$LINENO: checking for getservbyname in winsock2.h and -lws2_32" >&5 +echo $ECHO_N "checking for getservbyname in winsock2.h and -lws2_32... $ECHO_C" >&6; } +if test "${gl_cv_w32_getservbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gl_cv_w32_getservbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include + +int +main () +{ +getservbyname(NULL,NULL); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gl_cv_w32_getservbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_w32_getservbyname" >&5 +echo "${ECHO_T}$gl_cv_w32_getservbyname" >&6; } + if test "$gl_cv_w32_getservbyname" = "yes"; then + SERVENT_LIB="-lws2_32" + fi + +fi +done + + fi + + + + + + + + + + : @@ -32357,6 +35540,44 @@ _ACEOF fi + GNULIB_MALLOC_POSIX=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_ATOLL=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_MKDTEMP=0; + GNULIB_MKSTEMP=0; + GNULIB_PUTENV=0; + GNULIB_RANDOM_R=0; + GNULIB_RPMATCH=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_UNSETENV=0; + HAVE_ATOLL=1; + HAVE_CALLOC_POSIX=1; + HAVE_GETSUBOPT=1; + HAVE_MALLOC_POSIX=1; + HAVE_MKDTEMP=1; + HAVE_REALLOC_POSIX=1; + HAVE_RANDOM_R=1; + HAVE_RPMATCH=1; + HAVE_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNSETENV=1; + HAVE_DECL_GETLOADAVG=1; + REPLACE_MKSTEMP=0; + REPLACE_PUTENV=0; + REPLACE_STRTOD=0; + VOID_UNSETENV=0; + + if test -z "$GETOPT_H"; then for ac_header in getopt.h @@ -32861,67 +36082,6 @@ fi - { echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 -echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; } -if test "${am_cv_langinfo_codeset+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char* cs = nl_langinfo(CODESET); return !cs; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - am_cv_langinfo_codeset=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - am_cv_langinfo_codeset=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -echo "${ECHO_T}$am_cv_langinfo_codeset" >&6; } - if test $am_cv_langinfo_codeset = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LANGINFO_CODESET 1 -_ACEOF - - fi - - { echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then @@ -33086,25 +36246,6 @@ fi echo "${ECHO_T}$gl_cv_func_malloc_posix" >&6; } - GNULIB_MALLOC_POSIX=0; - GNULIB_REALLOC_POSIX=0; - GNULIB_CALLOC_POSIX=0; - GNULIB_GETSUBOPT=0; - GNULIB_MKDTEMP=0; - GNULIB_MKSTEMP=0; - GNULIB_PUTENV=0; - GNULIB_SETENV=0; - GNULIB_UNSETENV=0; - HAVE_CALLOC_POSIX=1; - HAVE_GETSUBOPT=1; - HAVE_MALLOC_POSIX=1; - HAVE_MKDTEMP=1; - HAVE_REALLOC_POSIX=1; - HAVE_SETENV=1; - HAVE_UNSETENV=1; - REPLACE_MKSTEMP=0; - REPLACE_PUTENV=0; - VOID_UNSETENV=0; @@ -33112,29 +36253,9 @@ echo "${ECHO_T}$gl_cv_func_malloc_posix" >&6; } - - - - - - - - - - - - - - - - - -for ac_func in $gl_func_list -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for mbstate_t" >&5 +echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6; } +if test "${ac_cv_type_mbstate_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -33143,53 +36264,24 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif - +$ac_includes_default +# include int main () { -return $ac_func (); +mbstate_t x; return sizeof x; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -33198,29 +36290,445 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + } && test -s conftest.$ac_objext; then + ac_cv_type_mbstate_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_type_mbstate_t=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +{ echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 +echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MBSTATE_T 1 _ACEOF + else + +cat >>confdefs.h <<\_ACEOF +#define mbstate_t int +_ACEOF + + fi + + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking for a traditional japanese locale" >&5 +echo $ECHO_N "checking for a traditional japanese locale... $ECHO_C" >&6; } +if test "${gt_cv_locale_ja+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS 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 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. */ + 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; +} + +_ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS 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 + fi + rm -fr conftest* + fi -done +{ echo "$as_me:$LINENO: result: $gt_cv_locale_ja" >&5 +echo "${ECHO_T}$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { echo "$as_me:$LINENO: checking for a transitional chinese locale" >&5 +echo $ECHO_N "checking for a transitional chinese locale... $ECHO_C" >&6; } +if test "${gt_cv_locale_zh_CN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS 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 a month name, no byte in the range 0x80..0x9F occurs. + 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) < 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; +} + +_ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS 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 + 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 +{ echo "$as_me:$LINENO: result: $gt_cv_locale_zh_CN" >&5 +echo "${ECHO_T}$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { echo "$as_me:$LINENO: checking for a french Unicode locale" >&5 +echo $ECHO_N "checking for a french Unicode locale... $ECHO_C" >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +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 (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS 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 + /* 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; + return 0; +} + +_ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS 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 + fi + rm -fr conftest* + +fi +{ echo "$as_me:$LINENO: result: $gt_cv_locale_fr_utf8" >&5 +echo "${ECHO_T}$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + + + + + + + + + gl_cv_c_multiarch=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; 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) + 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 + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + +cat >>confdefs.h <<\_ACEOF +#define AA_APPLE_UNIVERSAL_BUILD 1 +_ACEOF + + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + @@ -33311,15 +36819,23 @@ _ACEOF fi + GNULIB_FPRINTF=0; GNULIB_FPRINTF_POSIX=0; + GNULIB_PRINTF=0; GNULIB_PRINTF_POSIX=0; GNULIB_SNPRINTF=0; GNULIB_SPRINTF_POSIX=0; + GNULIB_VFPRINTF=0; GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; GNULIB_VPRINTF_POSIX=0; GNULIB_VSNPRINTF=0; GNULIB_VSPRINTF_POSIX=0; + GNULIB_DPRINTF=0; + GNULIB_VDPRINTF=0; GNULIB_VASPRINTF=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; GNULIB_FOPEN=0; GNULIB_FREOPEN=0; GNULIB_FSEEK=0; @@ -33327,9 +36843,19 @@ _ACEOF GNULIB_FTELL=0; GNULIB_FTELLO=0; GNULIB_FFLUSH=0; + GNULIB_FCLOSE=0; + GNULIB_FPUTC=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_FPUTS=0; + GNULIB_PUTS=0; + GNULIB_FWRITE=0; GNULIB_GETDELIM=0; GNULIB_GETLINE=0; - REPLACE_FPRINTF=0; + GNULIB_PERROR=0; + GNULIB_STDIO_H_SIGPIPE=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_FPRINTF=0; REPLACE_VFPRINTF=0; REPLACE_PRINTF=0; REPLACE_VPRINTF=0; @@ -33339,8 +36865,14 @@ _ACEOF HAVE_DECL_VSNPRINTF=1; REPLACE_SPRINTF=0; REPLACE_VSPRINTF=0; + HAVE_DPRINTF=1; + REPLACE_DPRINTF=0; + HAVE_VDPRINTF=1; + REPLACE_VDPRINTF=0; HAVE_VASPRINTF=1; REPLACE_VASPRINTF=0; + HAVE_DECL_OBSTACK_PRINTF=1; + REPLACE_OBSTACK_PRINTF=0; REPLACE_FOPEN=0; REPLACE_FREOPEN=0; HAVE_FSEEKO=1; @@ -33350,9 +36882,11 @@ _ACEOF REPLACE_FTELLO=0; REPLACE_FTELL=0; REPLACE_FFLUSH=0; + REPLACE_FCLOSE=0; HAVE_DECL_GETDELIM=1; HAVE_DECL_GETLINE=1; REPLACE_GETLINE=0; + REPLACE_PERROR=0; { echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 @@ -33864,6 +37398,7 @@ _ACEOF GNULIB_MEMMEM=0; GNULIB_MEMPCPY=0; GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; GNULIB_STPCPY=0; GNULIB_STPNCPY=0; GNULIB_STRCHRNUL=0; @@ -33891,9 +37426,11 @@ _ACEOF GNULIB_MBSTOK_R=0; GNULIB_STRERROR=0; GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; HAVE_DECL_MEMMEM=1; HAVE_MEMPCPY=1; HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; HAVE_STPCPY=1; HAVE_STPNCPY=1; HAVE_STRCHRNUL=1; @@ -33907,11 +37444,13 @@ _ACEOF HAVE_DECL_STRTOK_R=1; HAVE_DECL_STRERROR=1; HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMMEM=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; REPLACE_STRERROR=0; REPLACE_STRSIGNAL=0; - REPLACE_MEMMEM=0; - REPLACE_STRCASESTR=0; - REPLACE_STRSTR=0; { echo "$as_me:$LINENO: checking whether strdup is declared" >&5 @@ -33985,13 +37524,15 @@ fi - { echo "$as_me:$LINENO: checking for working strerror function" >&5 + + if test -z "$ERRNO_H"; then + { echo "$as_me:$LINENO: checking for working strerror function" >&5 echo $ECHO_N "checking for working strerror function... $ECHO_C" >&6; } if test "${gl_cv_func_working_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -34033,6 +37574,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -34083,11 +37625,17 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a fi + fi { echo "$as_me:$LINENO: result: $gl_cv_func_working_strerror" >&5 echo "${ECHO_T}$gl_cv_func_working_strerror" >&6; } - if test $gl_cv_func_working_strerror = no ; then - REPLACE_STRERROR=1 + if test $gl_cv_func_working_strerror = no; then + REPLACE_STRERROR=1 + fi + else + REPLACE_STRERROR=1 + fi + if test $REPLACE_STRERROR = 1; then { echo "$as_me:$LINENO: checking whether strerror is declared" >&5 echo $ECHO_N "checking whether strerror is declared... $ECHO_C" >&6; } @@ -34158,8 +37706,158 @@ fi + : + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + +for ac_header in winsock2.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + fi + fi + + @@ -34199,7 +37897,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_string_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/string.h#{ s#.*"\(.*/string.h\)".*#\1# s#^/[^/]#//&# @@ -34360,31 +38062,10 @@ fi - GNULIB_CHOWN=0; - GNULIB_DUP2=0; - GNULIB_FCHDIR=0; - GNULIB_FTRUNCATE=0; - GNULIB_GETCWD=0; - GNULIB_GETLOGIN_R=0; - GNULIB_GETPAGESIZE=0; - GNULIB_LCHOWN=0; - GNULIB_LSEEK=0; - GNULIB_READLINK=0; - GNULIB_SLEEP=0; - HAVE_DUP2=1; - HAVE_FTRUNCATE=1; - HAVE_GETPAGESIZE=1; - HAVE_READLINK=1; - HAVE_SLEEP=1; - HAVE_DECL_GETLOGIN_R=1; - HAVE_OS_H=0; - HAVE_SYS_PARAM_H=0; - REPLACE_CHOWN=0; - REPLACE_FCHDIR=0; - REPLACE_GETCWD=0; - REPLACE_GETPAGESIZE=0; - REPLACE_LCHOWN=0; - REPLACE_LSEEK=0; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRPTIME=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; @@ -34400,415 +38081,189 @@ fi - { echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 -echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6; } -if test "${ac_cv_decl_EOVERFLOW+set}" = set; then + : + + + + + + { echo "$as_me:$LINENO: checking for struct timespec in " >&5 +echo $ECHO_N "checking for struct timespec in ... $ECHO_C" >&6; } +if test "${gl_cv_sys_struct_timespec_in_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_sys_struct_timespec_in_time_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_sys_struct_timespec_in_time_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +echo "${ECHO_T}$gl_cv_sys_struct_timespec_in_time_h" >&6; } + + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { echo "$as_me:$LINENO: checking for struct timespec in " >&5 +echo $ECHO_N "checking for struct timespec in ... $ECHO_C" >&6; } +if test "${gl_cv_sys_struct_timespec_in_sys_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_sys_struct_timespec_in_sys_time_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_sys_struct_timespec_in_sys_time_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +echo "${ECHO_T}$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 + fi + fi + + + + + + + + + + + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_time_h='<'time.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_time_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_time_h = yes; then + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#include -#ifdef EOVERFLOW -yes -#endif +#include _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - have_eoverflow=1 -fi -rm -f conftest* - - if test -n "$have_eoverflow"; then - ac_cv_decl_EOVERFLOW=yes - else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -#ifdef EOVERFLOW -yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - have_eoverflow=1 -fi -rm -f conftest* - - if test -n "$have_eoverflow"; then - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_decl_EOVERFLOW=$ac_lo;; -'') ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -static long int longval () { return EOVERFLOW; } -static unsigned long int ulongval () { return EOVERFLOW; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if ((EOVERFLOW) < 0) - { - long int i = longval (); - if (i != (EOVERFLOW)) - return 1; - fprintf (f, "%ld\n", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (EOVERFLOW)) - return 1; - fprintf (f, "%lu\n", i); - } - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_decl_EOVERFLOW=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/time.h#{ + s#.*"\(.*/time.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_time_h='<'time.h'>' + fi fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val - else - ac_cv_decl_EOVERFLOW=E2BIG - fi - fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_time_h" >&5 +echo "${ECHO_T}$gl_cv_next_time_h" >&6; } + fi + NEXT_TIME_H=$gl_cv_next_time_h + + + + + + -fi -{ echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5 -echo "${ECHO_T}$ac_cv_decl_EOVERFLOW" >&6; } - if test "$ac_cv_decl_EOVERFLOW" != yes; then -cat >>confdefs.h <<_ACEOF -#define EOVERFLOW $ac_cv_decl_EOVERFLOW -_ACEOF - EOVERFLOW="$ac_cv_decl_EOVERFLOW" - fi @@ -35140,6 +38595,180 @@ _ACEOF fi + + + + + + + + + + +for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + { echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 +echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl__snprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _snprintf + (void) _snprintf; +#endif + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl__snprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl__snprintf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6; } +if test $ac_cv_have_decl__snprintf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF 0 +_ACEOF + + +fi + + + + { echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_vsnprintf+set}" = set; then @@ -35210,10 +38839,9 @@ fi - GNULIB_WCWIDTH=0; - HAVE_DECL_WCWIDTH=1; - REPLACE_WCWIDTH=0; - WCHAR_H= + + + @@ -35245,6 +38873,12 @@ fi + + + + + + gl_source_base='gl' @@ -35304,6 +38938,8 @@ _ACEOF + + : @@ -35311,12 +38947,67 @@ _ACEOF if test $ac_cv_header_arpa_inet_h = yes; then - ARPA_INET_H='' + HAVE_ARPA_INET_H=1 else ARPA_INET_H='arpa/inet.h' + 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 + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_arpa_inet_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_arpa_inet_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_arpa_inet_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/arpa/inet.h#{ + s#.*"\(.*/arpa/inet.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_arpa_inet_h" >&5 +echo "${ECHO_T}$gl_cv_next_arpa_inet_h" >&6; } + fi + NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h + + + + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then @@ -35369,6 +39060,127 @@ echo "${ECHO_T}$MKDIR_P" >&6; } + : + + + + + + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + + + { echo "$as_me:$LINENO: checking whether btowc(EOF) is correct" >&5 +echo $ECHO_N "checking whether btowc(EOF) is correct... $ECHO_C" >&6; } +if test "${gl_cv_func_btowc_eof+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_btowc_eof=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_btowc_eof=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_btowc_eof" >&5 +echo "${ECHO_T}$gl_cv_func_btowc_eof" >&6; } + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" + + + : + + fi + + + + GNULIB_BTOWC=1 + + + + + + @@ -35377,6 +39189,8 @@ echo "${ECHO_T}$MKDIR_P" >&6; } + + : @@ -35387,6 +39201,7 @@ echo "${ECHO_T}$MKDIR_P" >&6; } + gl_LIBOBJS="$gl_LIBOBJS cloexec.$ac_objext" @@ -35398,6 +39213,7 @@ echo "${ECHO_T}$MKDIR_P" >&6; } + gl_LIBOBJS="$gl_LIBOBJS basename.$ac_objext" @@ -35407,6 +39223,7 @@ echo "${ECHO_T}$MKDIR_P" >&6; } + gl_LIBOBJS="$gl_LIBOBJS dirname.$ac_objext" @@ -35416,6 +39233,7 @@ echo "${ECHO_T}$MKDIR_P" >&6; } + gl_LIBOBJS="$gl_LIBOBJS stripslash.$ac_objext" @@ -35446,8 +39264,8 @@ else gl_cv_double_slash_root='unknown, assuming no' ;; esac else - set x `ls -di / //` - if test $2 = $4 && wc //dev/null >/dev/null 2>&1; then + 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 @@ -35475,6 +39293,9 @@ _ACEOF + + + { echo "$as_me:$LINENO: checking for error_at_line" >&5 echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6; } if test "${ac_cv_lib_error_at_line+set}" = set; then @@ -35534,6 +39355,7 @@ if test $ac_cv_lib_error_at_line = no; then + gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" fi @@ -35559,6 +39381,7 @@ fi + gl_LIBOBJS="$gl_LIBOBJS exitfail.$ac_objext" @@ -35567,6 +39390,189 @@ fi + { echo "$as_me:$LINENO: checking for working fcntl.h" >&5 +echo $ECHO_N "checking for working fcntl.h... $ECHO_C" >&6; } +if test "${gl_cv_header_working_fcntl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + gl_cv_header_working_fcntl_h=cross-compiling +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + #include + #include + #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 status = !constants; + { + static char const sym[] = "conftest.sym"; + if (symlink (".", sym) != 0 + || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) + status |= 32; + } + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + char c; + struct stat st0, st1; + if (fd < 0 + || fstat (fd, &st0) != 0 + || sleep (1) != 0 + || read (fd, &c, 1) != 1 + || close (fd) != 0 + || stat (file, &st1) != 0 + || st0.st_atime != st1.st_atime) + status |= 64; + } + return status; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_working_fcntl_h=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +case $? in #( + 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 96) 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.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_working_fcntl_h" >&5 +echo "${ECHO_T}$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 + + + + + + + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_fcntl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_fcntl_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/fcntl.h#{ + s#.*"\(.*/fcntl.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_fcntl_h='<'fcntl.h'>' + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_fcntl_h" >&5 +echo "${ECHO_T}$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h + + + + FCNTL_H='fcntl.h' + + + + + + @@ -35581,6 +39587,7 @@ fi + gl_LIBOBJS="$gl_LIBOBJS creat-safer.$ac_objext" @@ -35601,6 +39608,7 @@ _ACEOF + : @@ -35628,7 +39636,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_float_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/float.h#{ s#.*"\(.*/float.h\)".*#\1# s#^/[^/]#//&# @@ -35725,6 +39737,9 @@ fi if test "$ac_cv_have_decl_floorf" = yes; then + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' if test "${gl_cv_func_floorf_libm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -35834,6 +39849,8 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ fi + as_echo_n="$saved_as_echo_n" + FLOORF_LIBM="$gl_cv_func_floorf_libm" if test "$FLOORF_LIBM" = "?"; then @@ -35850,6 +39867,7 @@ fi + gl_LIBOBJS="$gl_LIBOBJS floorf.$ac_objext" FLOORF_LIBM= @@ -35947,7 +39965,7 @@ echo "$as_me: checking how to get file system space usage" >&6;} 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) +# 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 @@ -35966,12 +39984,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#if defined __GLIBC__ && !defined __BEOS__ -Do not use statvfs on systems with GNU libc, because that function stats -all preceding entries in /proc/mounts, and that makes df hang if even +#if defined __GLIBC__ && defined __linux__ +Do not use statvfs on systems with GNU libc on Linux, because that function +stats all preceding entries in /proc/mounts, and that makes df hang if even one of the corresponding file systems is hard-mounted, but not available. -statvfs in GNU libc on BeOS operates differently: it only makes a system -call. +statvfs in GNU libc on Hurd, BeOS, Haiku operates differently: it only makes +a system call. #endif #ifdef __osf__ @@ -36475,6 +40493,7 @@ fi + gl_LIBOBJS="$gl_LIBOBJS fsusage.$ac_objext" @@ -36690,18 +40709,12 @@ echo "${ECHO_T}$fu_cv_sys_truncating_statfs" >&6; } fi - { echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5 + { echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5 echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;} + GETADDRINFO_LIB= + gai_saved_LIBS="$LIBS" - - : - - - - - - - { echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 + { echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6; } if test "${ac_cv_search_getaddrinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -36729,7 +40742,7 @@ return getaddrinfo (); return 0; } _ACEOF -for ac_lib in '' nsl socket; do +for ac_lib in '' socket network net; do if test -z "$ac_lib"; then ac_res="none required" else @@ -36781,9 +40794,13 @@ echo "${ECHO_T}$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" + { echo "$as_me:$LINENO: checking for getaddrinfo" >&5 echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6; } if test "${gl_cv_func_getaddrinfo+set}" = set; then @@ -36903,12 +40920,14 @@ fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" + LIBS="$am_save_LIBS" + fi { echo "$as_me:$LINENO: result: $gl_cv_w32_getaddrinfo" >&5 echo "${ECHO_T}$gl_cv_w32_getaddrinfo" >&6; } if test "$gl_cv_w32_getaddrinfo" = "yes"; then - LIBS="$LIBS -lws2_32" + GETADDRINFO_LIB="-lws2_32" + LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" else @@ -36917,6 +40936,7 @@ echo "${ECHO_T}$gl_cv_w32_getaddrinfo" >&6; } + gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext" fi @@ -36997,184 +41017,24 @@ echo "${ECHO_T}$gl_cv_func_gai_strerror" >&6; } + gl_LIBOBJS="$gl_LIBOBJS gai_strerror.$ac_objext" fi - - { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 -echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } -if test "${ac_cv_search_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 '' inet nsl; 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 - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_gethostbyname=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + LIBS="$gai_saved_LIBS" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_gethostbyname+set}" = set; then - break -fi -done -if test "${ac_cv_search_gethostbyname+set}" = set; then - : -else - ac_cv_search_gethostbyname=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 -echo "${ECHO_T}$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" - -fi - - { echo "$as_me:$LINENO: checking for library containing getservbyname" >&5 -echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6; } -if test "${ac_cv_search_getservbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 '' inet nsl socket xnet; 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 - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_getservbyname=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_getservbyname+set}" = set; then - break -fi -done -if test "${ac_cv_search_getservbyname+set}" = set; then - : -else - ac_cv_search_getservbyname=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5 -echo "${ECHO_T}$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" - -fi -for ac_func in gethostbyname -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + + + + { echo "$as_me:$LINENO: checking for struct sockaddr.sa_len" >&5 +echo $ECHO_N "checking for struct sockaddr.sa_len... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_sockaddr_sa_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -37183,53 +41043,26 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif +#include int main () { -return $ac_func (); +static struct sockaddr ac_aggr; +if (ac_aggr.sa_len) +return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -37238,66 +41071,38 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sockaddr_sa_len=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - - { echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5 -echo $ECHO_N "checking for gethostbyname in winsock2.h and -lws2_32... $ECHO_C" >&6; } -if test "${gl_cv_w32_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - gl_cv_w32_gethostbyname=no - am_save_LIBS="$LIBS" - LIBS="$LIBS -lws2_32" - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#ifdef HAVE_WINSOCK2_H -#include -#endif -#include +#include int main () { -gethostbyname(NULL); +static struct sockaddr ac_aggr; +if (sizeof ac_aggr.sa_len) +return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -37306,32 +41111,30 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - gl_cv_w32_gethostbyname=yes + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sockaddr_sa_len=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_member_struct_sockaddr_sa_len=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5 -echo "${ECHO_T}$gl_cv_w32_gethostbyname" >&6; } - if test "$gl_cv_w32_gethostbyname" = "yes"; then - LIBS="$LIBS -lws2_32" - fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_sa_len" >&5 +echo "${ECHO_T}$ac_cv_member_struct_sockaddr_sa_len" >&6; } +if test $ac_cv_member_struct_sockaddr_sa_len = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_SA_LEN 1 +_ACEOF + fi -done - - - - @@ -37342,8 +41145,6 @@ done - - { echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5 echo $ECHO_N "checking whether getaddrinfo is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getaddrinfo+set}" = set; then @@ -37670,6 +41471,19 @@ _ACEOF fi + 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 + { echo "$as_me:$LINENO: checking for struct addrinfo" >&5 echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6; } if test "${ac_cv_type_struct_addrinfo+set}" = set; then @@ -37744,6 +41558,188 @@ _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 + + + + + + + GNULIB_GETADDRINFO=1 + + + + + + + + : + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + +for ac_header in winsock2.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 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 @@ -37854,6 +41850,7 @@ done if test $ac_cv_func_gethostname = no; then + HAVE_GETHOSTNAME=0 for ac_func in uname @@ -37952,7 +41949,16 @@ done fi - gl_have_func=no # yes means we've found a way to get the load average. + + + GNULIB_GETHOSTNAME=1 + + + +# Persuade glibc to declare getloadavg(). + + +gl_have_func=no # yes means we've found a way to get the load average. # Make sure getloadavg.c is where it belongs, at configure-time. test -f "$srcdir/$gl_source_base/getloadavg.c" || @@ -38675,6 +42681,7 @@ else + gl_LIBOBJS="$gl_LIBOBJS getloadavg.$ac_objext" @@ -39646,6 +43653,220 @@ fi LIBS=$gl_save_LIBS +# Test whether the system declares getloadavg. Solaris has the function +# but declares it in , not . + +for ac_header in sys/loadavg.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 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 +{ echo "$as_me:$LINENO: checking whether getloadavg is declared" >&5 +echo $ECHO_N "checking whether getloadavg is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getloadavg+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if HAVE_SYS_LOADAVG_H + # include + #endif + #include + +int +main () +{ +#ifndef getloadavg + (void) getloadavg; +#endif + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_getloadavg=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getloadavg=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getloadavg" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getloadavg" >&6; } +if test $ac_cv_have_decl_getloadavg = yes; then + : +else + HAVE_DECL_GETLOADAVG=0 +fi + + + + + GNULIB_GETLOADAVG=1 + if test -n "$GETOPT_H"; then @@ -39657,6 +43878,7 @@ LIBS=$gl_save_LIBS + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" @@ -39666,6 +43888,7 @@ LIBS=$gl_save_LIBS + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" @@ -39694,6 +43917,351 @@ fi + HOSTENT_LIB= + gl_saved_libs="$LIBS" + { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 +echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } +if test "${ac_cv_search_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_gethostbyname=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_gethostbyname+set}" = set; then + break +fi +done +if test "${ac_cv_search_gethostbyname+set}" = set; then + : +else + ac_cv_search_gethostbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 +echo "${ECHO_T}$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 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + + { echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5 +echo $ECHO_N "checking for gethostbyname in winsock2.h and -lws2_32... $ECHO_C" >&6; } +if test "${gl_cv_w32_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gl_cv_w32_gethostbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include + +int +main () +{ +gethostbyname(NULL); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gl_cv_w32_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5 +echo "${ECHO_T}$gl_cv_w32_gethostbyname" >&6; } + if test "$gl_cv_w32_gethostbyname" = "yes"; then + HOSTENT_LIB="-lws2_32" + fi + +fi +done + + fi + + + + + + + + ARPA_INET_H='arpa/inet.h' + + + gl_save_LIBS=$LIBS + { echo "$as_me:$LINENO: checking for library containing inet_ntop" >&5 +echo $ECHO_N "checking for library containing inet_ntop... $ECHO_C" >&6; } +if test "${ac_cv_search_inet_ntop+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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; 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 + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_inet_ntop=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_inet_ntop+set}" = set; then + break +fi +done +if test "${ac_cv_search_inet_ntop+set}" = set; then + : +else + ac_cv_search_inet_ntop=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_inet_ntop" >&5 +echo "${ECHO_T}$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 + @@ -39800,15 +44368,9 @@ fi done +fi - - : - - - - - - + LIBS=$gl_save_LIBS { echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5 @@ -39880,12 +44442,19 @@ _ACEOF fi + if test $ac_cv_have_decl_inet_ntop = no; then + HAVE_DECL_INET_NTOP=0 + fi + GNULIB_INET_NTOP=1 + + + { echo "$as_me:$LINENO: checking whether the compiler generally respects inline" >&5 echo $ECHO_N "checking whether the compiler generally respects inline... $ECHO_C" >&6; } if test "${gl_cv_c_inline_effective+set}" = set; then @@ -40187,6 +44756,7 @@ _ACEOF + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" @@ -40220,6 +44790,7 @@ _ACEOF + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" HAVE_MALLOC_POSIX=0 @@ -40235,6 +44806,7 @@ _ACEOF + : @@ -40262,7 +44834,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_math_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_math_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/math.h#{ s#.*"\(.*/math.h\)".*#\1# s#^/[^/]#//&# @@ -40281,6 +44857,1202 @@ echo "${ECHO_T}$gl_cv_next_math_h" >&6; } + { echo "$as_me:$LINENO: checking whether NAN macro works" >&5 +echo $ECHO_N "checking whether NAN macro works... $ECHO_C" >&6; } +if test "${gl_cv_header_math_nan_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +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 +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_math_nan_works=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_header_math_nan_works=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_math_nan_works" >&5 +echo "${ECHO_T}$gl_cv_header_math_nan_works" >&6; } + if test $gl_cv_header_math_nan_works = no; then + REPLACE_NAN=1 + fi + { echo "$as_me:$LINENO: checking whether HUGE_VAL works" >&5 +echo $ECHO_N "checking whether HUGE_VAL works... $ECHO_C" >&6; } +if test "${gl_cv_header_math_huge_val_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +/* Solaris 10 has a broken definition of HUGE_VAL. */ + double d = HUGE_VAL; + return d == 0; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_math_huge_val_works=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_header_math_huge_val_works=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_math_huge_val_works" >&5 +echo "${ECHO_T}$gl_cv_header_math_huge_val_works" >&6; } + if test $gl_cv_header_math_huge_val_works = no; then + REPLACE_HUGE_VAL=1 + fi + + + + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { echo "$as_me:$LINENO: checking whether mbrtowc handles incomplete characters" >&5 +echo $ECHO_N "checking whether mbrtowc handles incomplete characters... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +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 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_incomplete_state=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +echo "${ECHO_T}$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { echo "$as_me:$LINENO: checking whether mbrtowc works as well as mbtowc" >&5 +echo $ECHO_N "checking whether mbrtowc works as well as mbtowc... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +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 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_sanitycheck=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +echo "${ECHO_T}$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 $REPLACE_MBSTATE_T = 1; then + + + WCHAR_H=wchar.h + + fi + + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + fi + + : + + + + + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + fi + if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then + + + + { echo "$as_me:$LINENO: checking whether mbrtowc handles a NULL string argument" >&5 +echo $ECHO_N "checking whether mbrtowc handles a NULL string argument... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc_null_arg+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +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 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_null_arg=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_mbrtowc_null_arg=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_null_arg" >&5 +echo "${ECHO_T}$gl_cv_func_mbrtowc_null_arg" >&6; } + + + + + + { echo "$as_me:$LINENO: checking whether mbrtowc has a correct return value" >&5 +echo $ECHO_N "checking whether mbrtowc has a correct return value... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc_retval+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + case "$host_os" in + # Guess no on HP-UX and Solaris. + hpux* | solaris*) 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; then + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* 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) + return 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) + return 1; + } + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_retval=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_mbrtowc_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_retval" >&5 +echo "${ECHO_T}$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { echo "$as_me:$LINENO: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +echo $ECHO_N "checking whether mbrtowc returns 0 when parsing a NUL character... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc_nul_retval+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +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 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_nul_retval=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +echo "${ECHO_T}$gl_cv_func_mbrtowc_nul_retval" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg" in + *yes) ;; + *) +cat >>confdefs.h <<\_ACEOF +#define MBRTOWC_NULL_ARG_BUG 1 +_ACEOF + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +cat >>confdefs.h <<\_ACEOF +#define MBRTOWC_RETVAL_BUG 1 +_ACEOF + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +cat >>confdefs.h <<\_ACEOF +#define MBRTOWC_NUL_RETVAL_BUG 1 +_ACEOF + + REPLACE_MBRTOWC=1 + ;; + esac + fi + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + + + : + + fi + + + + GNULIB_MBRTOWC=1 + + + + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { echo "$as_me:$LINENO: checking whether mbrtowc handles incomplete characters" >&5 +echo $ECHO_N "checking whether mbrtowc handles incomplete characters... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +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 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_incomplete_state=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +echo "${ECHO_T}$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { echo "$as_me:$LINENO: checking whether mbrtowc works as well as mbtowc" >&5 +echo $ECHO_N "checking whether mbrtowc works as well as mbtowc... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +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 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_sanitycheck=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +echo "${ECHO_T}$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 $REPLACE_MBSTATE_T = 1; then + + + WCHAR_H=wchar.h + + fi + + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + fi + + : + + + + + + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + fi + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" + + + : + + fi + + + + GNULIB_MBSINIT=1 + + + + : + + + + + + + : + + + + + + +if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple MacOS 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. + ac_cv_func_working_mktime=no +fi +{ echo "$as_me:$LINENO: checking for working mktime" >&5 +echo $ECHO_N "checking for working mktime... $ECHO_C" >&6; } +if test "${ac_cv_func_working_mktime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_working_mktime=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef HAVE_ALARM +# define alarm(X) /* empty */ +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +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. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + 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. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + 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)); +} + +int +main () +{ + time_t t, delta; + int i, j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + alarm (60); + + for (;;) + { + t = (time_t_max << 1) + 1; + if (t <= time_t_max) + break; + time_t_max = t; + } + time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - 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; t += delta) + if (! mktime_test (t)) + return 1; + if (! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + return 1; + + for (j = 1; ; j <<= 1) + if (! bigtime_test (j)) + return 1; + else if (INT_MAX / 2 < j) + break; + if (! bigtime_test (INT_MAX)) + return 1; + } + return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_working_mktime=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_working_mktime=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5 +echo "${ECHO_T}$ac_cv_func_working_mktime" >&6; } +if test $ac_cv_func_working_mktime = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + +fi + + if test $ac_cv_func_working_mktime = no; then + +cat >>confdefs.h <<\_ACEOF +#define mktime rpl_mktime +_ACEOF + + + + + fi @@ -41909,6 +47681,7 @@ fi + gl_LIBOBJS="$gl_LIBOBJS mountlist.$ac_objext" @@ -42170,6 +47943,118 @@ fi fi + + + + + + + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netdb_h='<'netdb.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_netdb_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_netdb_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_netdb_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/netdb.h#{ + s#.*"\(.*/netdb.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_netdb_h='<'netdb.h'>' + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_netdb_h" >&5 +echo "${ECHO_T}$gl_cv_next_netdb_h" >&6; } + fi + NEXT_NETDB_H=$gl_cv_next_netdb_h + + + + if test $ac_cv_header_netdb_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + struct addrinfo a; + int b = EAI_OVERFLOW; + int c = AI_NUMERICSERV; + +int +main () +{ + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + NETDB_H='' +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + NETDB_H='netdb.h' +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + HAVE_NETDB_H=1 + else + NETDB_H='netdb.h' + HAVE_NETDB_H=0 + fi + + + + { echo "$as_me:$LINENO: checking whether is self-contained" >&5 echo $ECHO_N "checking whether is self-contained... $ECHO_C" >&6; } if test "${gl_cv_header_netinet_in_h_selfcontained+set}" = set; then @@ -42368,6 +48253,7 @@ done + : @@ -42395,7 +48281,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_netinet_in_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_netinet_in_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/netinet/in.h#{ s#.*"\(.*/netinet/in.h\)".*#\1# s#^/[^/]#//&# @@ -42467,6 +48357,144 @@ echo "${ECHO_T}$MKDIR_P" >&6; } + case "$host_os" in + mingw* | pw*) + + + if test $REPLACE_OPEN != 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + REPLACE_OPEN=1 + + ;; + *) + { echo "$as_me:$LINENO: checking whether open recognizes a trailing slash" >&5 +echo $ECHO_N "checking whether open recognizes a trailing slash... $ECHO_C" >&6; } +if test "${gl_cv_func_open_slash+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + + case "$host_os" in + solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;; + hpux*) gl_cv_func_open_slash="guessing no" ;; + *) gl_cv_func_open_slash="guessing yes" ;; + esac + +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#if HAVE_UNISTD_H +# include +#endif +int main () +{ + return open ("conftest.sl/", O_CREAT, 0600) >= 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_open_slash=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_open_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + rm -f conftest.sl + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_open_slash" >&5 +echo "${ECHO_T}$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +cat >>confdefs.h <<\_ACEOF +#define OPEN_TRAILING_SLASH_BUG 1 +_ACEOF + + + + if test $REPLACE_OPEN != 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + REPLACE_OPEN=1 + + ;; + esac + ;; + esac + + + +cat >>confdefs.h <<\_ACEOF +#define GNULIB_OPEN 1 +_ACEOF + + + + + GNULIB_OPEN=1 + + + : @@ -42769,12 +48797,154 @@ _ACEOF + gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" + +for ac_header in libintl.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + : @@ -42787,12 +48957,6 @@ _ACEOF - - - - - - { echo "$as_me:$LINENO: checking whether isblank is declared" >&5 echo $ECHO_N "checking whether isblank is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_isblank+set}" = set; then @@ -42873,6 +49037,7 @@ fi + gl_LIBOBJS="$gl_LIBOBJS safe-read.$ac_objext" @@ -42888,6 +49053,7 @@ fi + gl_LIBOBJS="$gl_LIBOBJS safe-write.$ac_objext" @@ -42898,6 +49064,260 @@ fi + SERVENT_LIB= + gl_saved_libs="$LIBS" + { echo "$as_me:$LINENO: checking for library containing getservbyname" >&5 +echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6; } +if test "${ac_cv_search_getservbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 + 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_getservbyname=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_getservbyname+set}" = set; then + break +fi +done +if test "${ac_cv_search_getservbyname+set}" = set; then + : +else + ac_cv_search_getservbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5 +echo "${ECHO_T}$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 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + + { echo "$as_me:$LINENO: checking for getservbyname in winsock2.h and -lws2_32" >&5 +echo $ECHO_N "checking for getservbyname in winsock2.h and -lws2_32... $ECHO_C" >&6; } +if test "${gl_cv_w32_getservbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gl_cv_w32_getservbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include + +int +main () +{ +getservbyname(NULL,NULL); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gl_cv_w32_getservbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_w32_getservbyname" >&5 +echo "${ECHO_T}$gl_cv_w32_getservbyname" >&6; } + if test "$gl_cv_w32_getservbyname" = "yes"; then + SERVENT_LIB="-lws2_32" + fi + +fi +done + + fi + + + for ac_header in stdint.h do @@ -43763,6 +50183,7 @@ _ACEOF + gl_cv_func_snprintf_usable=no for ac_func in snprintf do @@ -43857,7 +50278,79 @@ _ACEOF fi done - if test $ac_cv_func_snprintf = no; then + if test $ac_cv_func_snprintf = yes; then + + + { echo "$as_me:$LINENO: checking whether snprintf respects a size of 1" >&5 +echo $ECHO_N "checking whether snprintf respects a size of 1... $ECHO_C" >&6; } +if test "${gl_cv_func_snprintf_size1+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + gl_cv_func_snprintf_size1="guessing yes" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_snprintf_size1=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_snprintf_size1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_snprintf_size1" >&5 +echo "${ECHO_T}$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + @@ -44140,6 +50633,7 @@ _ACEOF + : @@ -44167,7 +50661,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_stdint_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/stdint.h#{ s#.*"\(.*/stdint.h\)".*#\1# s#^/[^/]#//&# @@ -44384,7 +50882,123 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then + if test "$cross_compiling" = yes; then + gl_cv_header_working_stdint_h=yes + +else + cat >conftest.$ac_ext <<_ACEOF + + /* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#include +#include +#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 1; + } + return 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gl_cv_header_working_stdint_h=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -44393,6 +51007,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi { echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 echo "${ECHO_T}$gl_cv_header_working_stdint_h" >&6; } @@ -44564,13 +51179,418 @@ done + if test $APPLE_UNIVERSAL_BUILD = 0; then + + + + + for gltype in ptrdiff_t size_t ; do + { echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 +echo $ECHO_N "checking for bit size of $gltype... $ECHO_C" >&6; } +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) result=$ac_lo;; +'') result=unknown ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include +static long int longval () { return sizeof ($gltype) * CHAR_BIT; } +static unsigned long int ulongval () { return sizeof ($gltype) * CHAR_BIT; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((sizeof ($gltype) * CHAR_BIT) < 0) + { + long int i = longval (); + if (i != (sizeof ($gltype) * CHAR_BIT)) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (sizeof ($gltype) * CHAR_BIT)) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + result=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +result=unknown +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val + eval gl_cv_bitsizeof_${gltype}=\$result + +fi +ac_res=`eval echo '${'gl_cv_bitsizeof_${gltype}'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$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 ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do + for gltype in sig_atomic_t wchar_t wint_t ; do { echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 echo $ECHO_N "checking for bit size of $gltype... $ECHO_C" >&6; } if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then @@ -45055,14 +52075,113 @@ _ACEOF 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 + { echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 +echo $ECHO_N "checking for $gltype integer literal suffix... $ECHO_C" >&6; } +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval gl_cv_type_${gltype}_suffix=\$glsuf +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +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 +ac_res=`eval echo '${'gl_cv_type_${gltype}_suffix'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$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 ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do + for gltype in sig_atomic_t wchar_t wint_t ; do { echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 echo $ECHO_N "checking for $gltype integer literal suffix... $ECHO_C" >&6; } if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then @@ -45167,6 +52286,7 @@ _ACEOF + : @@ -45194,7 +52314,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_stdio_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/stdio.h#{ s#.*"\(.*/stdio.h\)".*#\1# s#^/[^/]#//&# @@ -45213,6 +52337,18 @@ echo "${ECHO_T}$gl_cv_next_stdio_h" >&6; } + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + + @@ -45246,7 +52382,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_stdlib_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/stdlib.h#{ s#.*"\(.*/stdlib.h\)".*#\1# s#^/[^/]#//&# @@ -45266,7 +52406,155 @@ echo "${ECHO_T}$gl_cv_next_stdlib_h" >&6; } +for ac_header in random.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_random_h = yes; then + HAVE_RANDOM_H=1 + else + HAVE_RANDOM_H=0 + fi + + { echo "$as_me:$LINENO: checking for struct random_data" >&5 +echo $ECHO_N "checking for struct random_data... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_random_data+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #if HAVE_RANDOM_H + # include + #endif + + +typedef struct random_data ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_struct_random_data=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_random_data=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_random_data" >&5 +echo "${ECHO_T}$ac_cv_type_struct_random_data" >&6; } +if test $ac_cv_type_struct_random_data = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_RANDOM_DATA 1 +_ACEOF + + +else + HAVE_STRUCT_RANDOM_DATA=0 +fi + + + + + + if test $gl_cv_func_malloc_posix != yes; then + REPLACE_STRDUP=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext" + + else @@ -45374,6 +52662,7 @@ fi done + fi : @@ -45392,7 +52681,8 @@ done - if test $gl_cv_func_working_strerror = no; then + if test $REPLACE_STRERROR = 1; then + @@ -45553,7 +52843,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include + #include int main () { @@ -45621,6 +52911,7 @@ _ACEOF + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" : @@ -45726,6 +53017,7 @@ test $ac_cv_func_strnlen_working = no && + gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" @@ -45733,7 +53025,7 @@ test $ac_cv_func_strnlen_working = no && # This is necessary because automake-1.6.1 doesn't understand # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. - #AC_LIBOBJ(strnlen) + #AC_LIBOBJ([strnlen]) cat >>confdefs.h <<\_ACEOF #define strnlen rpl_strnlen @@ -45747,6 +53039,9 @@ _ACEOF GNULIB_STRNLEN=1 + + + { echo "$as_me:$LINENO: checking whether is self-contained" >&5 echo $ECHO_N "checking whether is self-contained... $ECHO_C" >&6; } if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then @@ -45800,8 +53095,161 @@ fi echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; } if test $gl_cv_header_sys_socket_h_selfcontained = yes; then SYS_SOCKET_H='' + +for ac_func in shutdown +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + if test $ac_cv_func_shutdown = yes; then + { echo "$as_me:$LINENO: checking whether defines the SHUT_* macros" >&5 +echo $ECHO_N "checking whether defines the SHUT_* macros... $ECHO_C" >&6; } +if test "${gl_cv_header_sys_socket_h_shut+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_sys_socket_h_shut=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_header_sys_socket_h_shut=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_shut" >&5 +echo "${ECHO_T}$gl_cv_header_sys_socket_h_shut" >&6; } + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi else SYS_SOCKET_H='sys/socket.h' + fi + # We need to check for ws2tcpip.h now. + @@ -45833,7 +53281,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_sys_socket_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_socket_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/sys/socket.h#{ s#.*"\(.*/sys/socket.h\)".*#\1# s#^/[^/]#//&# @@ -45852,15 +53304,13 @@ echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; } - if test $ac_cv_header_sys_socket_h = yes; then - HAVE_SYS_SOCKET_H=1 - HAVE_WINSOCK2_H=0 - HAVE_WS2TCPIP_H=0 - else - HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 - -for ac_header in winsock2.h ws2tcpip.h +for ac_header in ws2tcpip.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -45999,20 +53449,255 @@ fi done - if test $ac_cv_header_winsock2_h = yes; then - HAVE_WINSOCK2_H=1 - else - HAVE_WINSOCK2_H=0 - fi - if test $ac_cv_header_ws2tcpip_h = yes; then - HAVE_WS2TCPIP_H=1 - else - HAVE_WS2TCPIP_H=0 - fi + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 fi + fi + { echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5 +echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_sockaddr_storage+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* 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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif + + +typedef struct sockaddr_storage ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_struct_sockaddr_storage=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_sockaddr_storage=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_storage" >&5 +echo "${ECHO_T}$ac_cv_type_struct_sockaddr_storage" >&6; } +if test $ac_cv_type_struct_sockaddr_storage = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +_ACEOF + + +fi + + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + SYS_SOCKET_H='sys/socket.h' + fi + if test -n "$SYS_SOCKET_H"; then + + + + + : + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + +for ac_header in winsock2.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 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 @@ -46064,6 +53749,402 @@ echo "${ECHO_T}$MKDIR_P" >&6; } + + + + { echo "$as_me:$LINENO: checking whether localtime_r is compatible with its POSIX signature" >&5 +echo $ECHO_N "checking whether localtime_r is compatible with its POSIX signature... $ECHO_C" >&6; } +if test "${gl_cv_time_r_posix+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +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 +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_time_r_posix=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_time_r_posix=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_time_r_posix" >&5 +echo "${ECHO_T}$gl_cv_time_r_posix" >&6; } + if test $gl_cv_time_r_posix = yes; then + REPLACE_LOCALTIME_R=0 + else + REPLACE_LOCALTIME_R=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" + + + : + + fi + + + + + if test $ac_cv_func_working_mktime = no; then + # Assume that timegm is buggy if mktime is. + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS timegm.$ac_objext" + + ac_cv_func_timegm=no + else + + + + + + + + + +for ac_func in timegm +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + +fi +done + + + fi + REPLACE_TIMEGM=1 + if test $ac_cv_func_timegm = yes; then + { echo "$as_me:$LINENO: checking whether timegm is declared" >&5 +echo $ECHO_N "checking whether timegm is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_timegm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef timegm + (void) timegm; +#endif + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_timegm=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_timegm=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_timegm" >&5 +echo "${ECHO_T}$ac_cv_have_decl_timegm" >&6; } +if test $ac_cv_have_decl_timegm = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TIMEGM 1 +_ACEOF + +REPLACE_TIMEGM=0 +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TIMEGM 0 +_ACEOF + + +fi + + + fi + if test $REPLACE_TIMEGM = 1; then + + + + if test $ac_cv_func_working_mktime = yes; then + { echo "$as_me:$LINENO: checking for __mktime_internal" >&5 +echo $ECHO_N "checking for __mktime_internal... $ECHO_C" >&6; } +if test "${ac_cv_func___mktime_internal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define __mktime_internal to an innocuous variant, in case declares __mktime_internal. + For example, HP-UX 11i declares gettimeofday. */ +#define __mktime_internal innocuous___mktime_internal + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char __mktime_internal (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef __mktime_internal + +/* 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 __mktime_internal (); +/* 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___mktime_internal || defined __stub_____mktime_internal +choke me +#endif + +int +main () +{ +return __mktime_internal (); + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func___mktime_internal=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func___mktime_internal=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func___mktime_internal" >&5 +echo "${ECHO_T}$ac_cv_func___mktime_internal" >&6; } +if test $ac_cv_func___mktime_internal = yes; then + : +else + # mktime works but it doesn't export __mktime_internal, + # so we need to substitute our own mktime implementation. + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + + +cat >>confdefs.h <<\_ACEOF +#define mktime rpl_mktime +_ACEOF + + + + +fi + + fi + + fi + + + + + + + + : @@ -46091,7 +54172,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_unistd_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/unistd.h#{ s#.*"\(.*/unistd.h\)".*#\1# s#^/[^/]#//&# @@ -46140,6 +54225,7 @@ echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } + gl_LIBOBJS="$gl_LIBOBJS dup-safer.$ac_objext" @@ -46149,6 +54235,7 @@ echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } + gl_LIBOBJS="$gl_LIBOBJS fd-safer.$ac_objext" @@ -46158,8 +54245,8 @@ echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } - gl_LIBOBJS="$gl_LIBOBJS pipe-safer.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS pipe-safer.$ac_objext" @@ -46186,6 +54273,7 @@ echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" @@ -46195,6 +54283,7 @@ echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" @@ -46204,6 +54293,7 @@ echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" @@ -46213,6 +54303,7 @@ echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" if test $ac_cv_func_vasnprintf = yes; then @@ -46302,175 +54393,6 @@ fi - - - -for ac_func in snprintf wcslen -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - { echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 -echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl__snprintf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef _snprintf - (void) _snprintf; -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl__snprintf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl__snprintf=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6; } -if test $ac_cv_have_decl__snprintf = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SNPRINTF 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SNPRINTF 0 -_ACEOF - - -fi - - - - - - fi @@ -46577,6 +54499,7 @@ done + gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext" @@ -46586,6 +54509,7 @@ done + gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext" @@ -46618,6 +54542,7 @@ done + gl_cv_func_vsnprintf_usable=no for ac_func in vsnprintf do @@ -46712,7 +54637,79 @@ _ACEOF fi done - if test $ac_cv_func_vsnprintf = no; then + if test $ac_cv_func_vsnprintf = yes; then + + + { echo "$as_me:$LINENO: checking whether snprintf respects a size of 1" >&5 +echo $ECHO_N "checking whether snprintf respects a size of 1... $ECHO_C" >&6; } +if test "${gl_cv_func_snprintf_size1+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + gl_cv_func_snprintf_size1="guessing yes" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_snprintf_size1=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_snprintf_size1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_snprintf_size1" >&5 +echo "${ECHO_T}$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_cv_func_vsnprintf_usable=yes + ;; + esac + fi + if test $gl_cv_func_vsnprintf_usable = no; then + @@ -46785,7 +54782,16 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5 echo "${ECHO_T}$gl_cv_header_wchar_h_standalone" >&6; } - if test $gl_cv_header_wchar_h_standalone != yes; then + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then WCHAR_H=wchar.h fi @@ -46805,6 +54811,7 @@ echo "${ECHO_T}$gl_cv_header_wchar_h_standalone" >&6; } + : @@ -46832,7 +54839,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_wchar_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/wchar.h#{ s#.*"\(.*/wchar.h\)".*#\1# s#^/[^/]#//&# @@ -46854,6 +54865,358 @@ echo "${ECHO_T}$gl_cv_next_wchar_h" >&6; } + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { echo "$as_me:$LINENO: checking whether mbrtowc handles incomplete characters" >&5 +echo $ECHO_N "checking whether mbrtowc handles incomplete characters... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +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 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_incomplete_state=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +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.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +echo "${ECHO_T}$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { echo "$as_me:$LINENO: checking whether mbrtowc works as well as mbtowc" >&5 +echo $ECHO_N "checking whether mbrtowc works as well as mbtowc... $ECHO_C" >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +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 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_sanitycheck=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +echo "${ECHO_T}$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 $REPLACE_MBSTATE_T = 1; then + + + WCHAR_H=wchar.h + + fi + + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + fi + + : + + + + + + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + fi + if test $HAVE_WCRTOMB != 0 && test $REPLACE_WCRTOMB != 1; then + + + + + + { echo "$as_me:$LINENO: checking whether wcrtomb return value is correct" >&5 +echo $ECHO_N "checking whether wcrtomb return value is correct... $ECHO_C" >&6; } +if test "${gl_cv_func_wcrtomb_retval+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_wcrtomb_retval=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_wcrtomb_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_wcrtomb_retval" >&5 +echo "${ECHO_T}$gl_cv_func_wcrtomb_retval" >&6; } + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext" + + + : + + fi + + + + GNULIB_WCRTOMB=1 + + + + : @@ -46886,11 +55249,117 @@ echo "${ECHO_T}$gl_cv_next_wchar_h" >&6; } WCTYPE_H=wctype.h if test $ac_cv_header_wctype_h = yes; then if test $ac_cv_func_iswcntrl = yes; then - WCTYPE_H= + { echo "$as_me:$LINENO: checking whether iswcntrl works" >&5 +echo $ECHO_N "checking whether iswcntrl works... $ECHO_C" >&6; } +if test "${gl_cv_func_iswcntrl_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_func_iswcntrl_works=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_func_iswcntrl_works=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_iswcntrl_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_iswcntrl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_iswcntrl_works" >&5 +echo "${ECHO_T}$gl_cv_func_iswcntrl_works" >&6; } + if test $gl_cv_func_iswcntrl_works = yes; then + WCTYPE_H= + fi fi + : @@ -46918,7 +55387,11 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF - gl_cv_next_wctype_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/wctype.h#{ s#.*"\(.*/wctype.h\)".*#\1# s#^/[^/]#//&# @@ -46944,6 +55417,22 @@ echo "${ECHO_T}$gl_cv_next_wctype_h" >&6; } + if test "$gl_cv_func_iswcntrl_works" = no; then + REPLACE_ISWCNTRL=1 + else + REPLACE_ISWCNTRL=0 + fi + + + + + + + + + GNULIB_WRITE=1 + + @@ -47116,16 +55605,30 @@ done + + + + + gltests_libdeps= gltests_ltlibdeps= + + + + + + gl_source_base='tests' + + + LIBGNU_LIBDEPS="$gl_libdeps" LIBGNU_LTLIBDEPS="$gl_ltlibdeps" @@ -47138,7 +55641,7 @@ echo "$as_me: error: No ar found for Solaris - is /usr/ccs/bin in PATH?" >&2;} { (exit 1); exit 1; }; } fi -ac_config_files="$ac_config_files Makefile lib/Makefile plugins/Makefile lib/tests/Makefile plugins-root/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh perlmods/Makefile command.cfg test.pl pkg/solaris/pkginfo po/Makefile.in" +ac_config_files="$ac_config_files Makefile tap/Makefile lib/Makefile plugins/Makefile lib/tests/Makefile plugins-root/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh perlmods/Makefile command.cfg test.pl pkg/solaris/pkginfo po/Makefile.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -47257,6 +55760,20 @@ echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${RELEASE_PRESENT_TRUE}" && test -z "${RELEASE_PRESENT_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"RELEASE_PRESENT\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"RELEASE_PRESENT\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${USE_LIBTAP_LOCAL_TRUE}" && test -z "${USE_LIBTAP_LOCAL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USE_LIBTAP_LOCAL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USE_LIBTAP_LOCAL\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${USE_PARSE_INI_TRUE}" && test -z "${USE_PARSE_INI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_PARSE_INI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -47603,7 +56120,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by nagios-plugins $as_me 1.4.12, which was +This file was extended by nagios-plugins $as_me 1.4.13, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -47656,7 +56173,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -nagios-plugins config.status 1.4.12 +nagios-plugins config.status 1.4.13 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -47782,6 +56299,7 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "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" ;; @@ -48010,6 +56528,8 @@ with_trusted_path!$with_trusted_path$ac_delim PKG_ARCH!$PKG_ARCH$ac_delim REV_DATESTAMP!$REV_DATESTAMP$ac_delim REV_TIMESTAMP!$REV_TIMESTAMP$ac_delim +RELEASE_PRESENT_TRUE!$RELEASE_PRESENT_TRUE$ac_delim +RELEASE_PRESENT_FALSE!$RELEASE_PRESENT_FALSE$ac_delim PYTHON!$PYTHON$ac_delim SH!$SH$ac_delim PERL!$PERL$ac_delim @@ -48018,6 +56538,8 @@ HOSTNAME!$HOSTNAME$ac_delim BASENAME!$BASENAME$ac_delim SOCKETLIBS!$SOCKETLIBS$ac_delim MATHLIBS!$MATHLIBS$ac_delim +USE_LIBTAP_LOCAL_TRUE!$USE_LIBTAP_LOCAL_TRUE$ac_delim +USE_LIBTAP_LOCAL_FALSE!$USE_LIBTAP_LOCAL_FALSE$ac_delim EXTRA_TEST!$EXTRA_TEST$ac_delim USE_PARSE_INI_TRUE!$USE_PARSE_INI_TRUE$ac_delim USE_PARSE_INI_FALSE!$USE_PARSE_INI_FALSE$ac_delim @@ -48083,15 +56605,11 @@ GL_COND_LIBTOOL_TRUE!$GL_COND_LIBTOOL_TRUE$ac_delim GL_COND_LIBTOOL_FALSE!$GL_COND_LIBTOOL_FALSE$ac_delim ALLOCA!$ALLOCA$ac_delim ALLOCA_H!$ALLOCA_H$ac_delim +GNULIB_INET_NTOP!$GNULIB_INET_NTOP$ac_delim +GNULIB_INET_PTON!$GNULIB_INET_PTON$ac_delim +HAVE_DECL_INET_NTOP!$HAVE_DECL_INET_NTOP$ac_delim +HAVE_DECL_INET_PTON!$HAVE_DECL_INET_PTON$ac_delim ARPA_INET_H!$ARPA_INET_H$ac_delim -INCLUDE_NEXT!$INCLUDE_NEXT$ac_delim -NEXT_FLOAT_H!$NEXT_FLOAT_H$ac_delim -FLOAT_H!$FLOAT_H$ac_delim -GNULIB_CEILF!$GNULIB_CEILF$ac_delim -GNULIB_CEILL!$GNULIB_CEILL$ac_delim -GNULIB_FLOORF!$GNULIB_FLOORF$ac_delim -GNULIB_FLOORL!$GNULIB_FLOORL$ac_delim -GNULIB_FREXP!$GNULIB_FREXP$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -48133,8 +56651,73 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +HAVE_ARPA_INET_H!$HAVE_ARPA_INET_H$ac_delim +INCLUDE_NEXT!$INCLUDE_NEXT$ac_delim +INCLUDE_NEXT_AS_FIRST_DIRECTIVE!$INCLUDE_NEXT_AS_FIRST_DIRECTIVE$ac_delim +PRAGMA_SYSTEM_HEADER!$PRAGMA_SYSTEM_HEADER$ac_delim +NEXT_ARPA_INET_H!$NEXT_ARPA_INET_H$ac_delim +GNULIB_BTOWC!$GNULIB_BTOWC$ac_delim +GNULIB_WCTOB!$GNULIB_WCTOB$ac_delim +GNULIB_MBSINIT!$GNULIB_MBSINIT$ac_delim +GNULIB_MBRTOWC!$GNULIB_MBRTOWC$ac_delim +GNULIB_MBRLEN!$GNULIB_MBRLEN$ac_delim +GNULIB_MBSRTOWCS!$GNULIB_MBSRTOWCS$ac_delim +GNULIB_MBSNRTOWCS!$GNULIB_MBSNRTOWCS$ac_delim +GNULIB_WCRTOMB!$GNULIB_WCRTOMB$ac_delim +GNULIB_WCSRTOMBS!$GNULIB_WCSRTOMBS$ac_delim +GNULIB_WCSNRTOMBS!$GNULIB_WCSNRTOMBS$ac_delim +GNULIB_WCWIDTH!$GNULIB_WCWIDTH$ac_delim +HAVE_BTOWC!$HAVE_BTOWC$ac_delim +HAVE_MBSINIT!$HAVE_MBSINIT$ac_delim +HAVE_MBRTOWC!$HAVE_MBRTOWC$ac_delim +HAVE_MBRLEN!$HAVE_MBRLEN$ac_delim +HAVE_MBSRTOWCS!$HAVE_MBSRTOWCS$ac_delim +HAVE_MBSNRTOWCS!$HAVE_MBSNRTOWCS$ac_delim +HAVE_WCRTOMB!$HAVE_WCRTOMB$ac_delim +HAVE_WCSRTOMBS!$HAVE_WCSRTOMBS$ac_delim +HAVE_WCSNRTOMBS!$HAVE_WCSNRTOMBS$ac_delim +HAVE_DECL_WCTOB!$HAVE_DECL_WCTOB$ac_delim +HAVE_DECL_WCWIDTH!$HAVE_DECL_WCWIDTH$ac_delim +REPLACE_MBSTATE_T!$REPLACE_MBSTATE_T$ac_delim +REPLACE_BTOWC!$REPLACE_BTOWC$ac_delim +REPLACE_WCTOB!$REPLACE_WCTOB$ac_delim +REPLACE_MBSINIT!$REPLACE_MBSINIT$ac_delim +REPLACE_MBRTOWC!$REPLACE_MBRTOWC$ac_delim +REPLACE_MBRLEN!$REPLACE_MBRLEN$ac_delim +REPLACE_MBSRTOWCS!$REPLACE_MBSRTOWCS$ac_delim +REPLACE_MBSNRTOWCS!$REPLACE_MBSNRTOWCS$ac_delim +REPLACE_WCRTOMB!$REPLACE_WCRTOMB$ac_delim +REPLACE_WCSRTOMBS!$REPLACE_WCSRTOMBS$ac_delim +REPLACE_WCSNRTOMBS!$REPLACE_WCSNRTOMBS$ac_delim +REPLACE_WCWIDTH!$REPLACE_WCWIDTH$ac_delim +WCHAR_H!$WCHAR_H$ac_delim +LOCALE_FR!$LOCALE_FR$ac_delim +NEXT_ERRNO_H!$NEXT_ERRNO_H$ac_delim +ERRNO_H!$ERRNO_H$ac_delim +EMULTIHOP_HIDDEN!$EMULTIHOP_HIDDEN$ac_delim +EMULTIHOP_VALUE!$EMULTIHOP_VALUE$ac_delim +ENOLINK_HIDDEN!$ENOLINK_HIDDEN$ac_delim +ENOLINK_VALUE!$ENOLINK_VALUE$ac_delim +EOVERFLOW_HIDDEN!$EOVERFLOW_HIDDEN$ac_delim +EOVERFLOW_VALUE!$EOVERFLOW_VALUE$ac_delim +GNULIB_OPEN!$GNULIB_OPEN$ac_delim +REPLACE_OPEN!$REPLACE_OPEN$ac_delim +NEXT_FCNTL_H!$NEXT_FCNTL_H$ac_delim +FCNTL_H!$FCNTL_H$ac_delim +NEXT_FLOAT_H!$NEXT_FLOAT_H$ac_delim +FLOAT_H!$FLOAT_H$ac_delim +GNULIB_CEILF!$GNULIB_CEILF$ac_delim +GNULIB_CEILL!$GNULIB_CEILL$ac_delim +GNULIB_FLOORF!$GNULIB_FLOORF$ac_delim +GNULIB_FLOORL!$GNULIB_FLOORL$ac_delim +GNULIB_FREXP!$GNULIB_FREXP$ac_delim GNULIB_FREXPL!$GNULIB_FREXPL$ac_delim GNULIB_ISFINITE!$GNULIB_ISFINITE$ac_delim +GNULIB_ISINF!$GNULIB_ISINF$ac_delim +GNULIB_ISNAN!$GNULIB_ISNAN$ac_delim +GNULIB_ISNANF!$GNULIB_ISNANF$ac_delim +GNULIB_ISNAND!$GNULIB_ISNAND$ac_delim +GNULIB_ISNANL!$GNULIB_ISNANL$ac_delim GNULIB_LDEXPL!$GNULIB_LDEXPL$ac_delim GNULIB_MATHL!$GNULIB_MATHL$ac_delim GNULIB_ROUND!$GNULIB_ROUND$ac_delim @@ -48144,6 +56727,9 @@ GNULIB_SIGNBIT!$GNULIB_SIGNBIT$ac_delim GNULIB_TRUNC!$GNULIB_TRUNC$ac_delim GNULIB_TRUNCF!$GNULIB_TRUNCF$ac_delim GNULIB_TRUNCL!$GNULIB_TRUNCL$ac_delim +HAVE_ISNANF!$HAVE_ISNANF$ac_delim +HAVE_ISNAND!$HAVE_ISNAND$ac_delim +HAVE_ISNANL!$HAVE_ISNANL$ac_delim HAVE_DECL_ACOSL!$HAVE_DECL_ACOSL$ac_delim HAVE_DECL_ASINL!$HAVE_DECL_ASINL$ac_delim HAVE_DECL_ATANL!$HAVE_DECL_ATANL$ac_delim @@ -48157,79 +56743,11 @@ HAVE_DECL_SQRTL!$HAVE_DECL_SQRTL$ac_delim HAVE_DECL_TANL!$HAVE_DECL_TANL$ac_delim HAVE_DECL_TRUNC!$HAVE_DECL_TRUNC$ac_delim HAVE_DECL_TRUNCF!$HAVE_DECL_TRUNCF$ac_delim -HAVE_DECL_TRUNCL!$HAVE_DECL_TRUNCL$ac_delim REPLACE_CEILF!$REPLACE_CEILF$ac_delim REPLACE_CEILL!$REPLACE_CEILL$ac_delim REPLACE_FLOORF!$REPLACE_FLOORF$ac_delim REPLACE_FLOORL!$REPLACE_FLOORL$ac_delim REPLACE_FREXP!$REPLACE_FREXP$ac_delim -REPLACE_FREXPL!$REPLACE_FREXPL$ac_delim -REPLACE_ISFINITE!$REPLACE_ISFINITE$ac_delim -REPLACE_LDEXPL!$REPLACE_LDEXPL$ac_delim -REPLACE_ROUND!$REPLACE_ROUND$ac_delim -REPLACE_ROUNDF!$REPLACE_ROUNDF$ac_delim -REPLACE_ROUNDL!$REPLACE_ROUNDL$ac_delim -REPLACE_SIGNBIT!$REPLACE_SIGNBIT$ac_delim -REPLACE_SIGNBIT_USING_GCC!$REPLACE_SIGNBIT_USING_GCC$ac_delim -FLOORF_LIBM!$FLOORF_LIBM$ac_delim -NEXT_SYS_SOCKET_H!$NEXT_SYS_SOCKET_H$ac_delim -HAVE_SYS_SOCKET_H!$HAVE_SYS_SOCKET_H$ac_delim -HAVE_WINSOCK2_H!$HAVE_WINSOCK2_H$ac_delim -HAVE_WS2TCPIP_H!$HAVE_WS2TCPIP_H$ac_delim -SYS_SOCKET_H!$SYS_SOCKET_H$ac_delim -NEED_SETGID!$NEED_SETGID$ac_delim -KMEM_GROUP!$KMEM_GROUP$ac_delim -GETLOADAVG_LIBS!$GETLOADAVG_LIBS$ac_delim -GETOPT_H!$GETOPT_H$ac_delim -GLIBC21!$GLIBC21$ac_delim -LOCALCHARSET_TESTS_ENVIRONMENT!$LOCALCHARSET_TESTS_ENVIRONMENT$ac_delim -HAVE_MALLOC_POSIX!$HAVE_MALLOC_POSIX$ac_delim -GNULIB_MALLOC_POSIX!$GNULIB_MALLOC_POSIX$ac_delim -GNULIB_REALLOC_POSIX!$GNULIB_REALLOC_POSIX$ac_delim -GNULIB_CALLOC_POSIX!$GNULIB_CALLOC_POSIX$ac_delim -GNULIB_GETSUBOPT!$GNULIB_GETSUBOPT$ac_delim -GNULIB_MKDTEMP!$GNULIB_MKDTEMP$ac_delim -GNULIB_MKSTEMP!$GNULIB_MKSTEMP$ac_delim -GNULIB_PUTENV!$GNULIB_PUTENV$ac_delim -GNULIB_SETENV!$GNULIB_SETENV$ac_delim -GNULIB_UNSETENV!$GNULIB_UNSETENV$ac_delim -HAVE_CALLOC_POSIX!$HAVE_CALLOC_POSIX$ac_delim -HAVE_GETSUBOPT!$HAVE_GETSUBOPT$ac_delim -HAVE_MKDTEMP!$HAVE_MKDTEMP$ac_delim -HAVE_REALLOC_POSIX!$HAVE_REALLOC_POSIX$ac_delim -HAVE_SETENV!$HAVE_SETENV$ac_delim -HAVE_UNSETENV!$HAVE_UNSETENV$ac_delim -REPLACE_MKSTEMP!$REPLACE_MKSTEMP$ac_delim -REPLACE_PUTENV!$REPLACE_PUTENV$ac_delim -VOID_UNSETENV!$VOID_UNSETENV$ac_delim -NEXT_MATH_H!$NEXT_MATH_H$ac_delim -NEXT_NETINET_IN_H!$NEXT_NETINET_IN_H$ac_delim -HAVE_NETINET_IN_H!$HAVE_NETINET_IN_H$ac_delim -NETINET_IN_H!$NETINET_IN_H$ac_delim -GNULIB_FPRINTF_POSIX!$GNULIB_FPRINTF_POSIX$ac_delim -GNULIB_PRINTF_POSIX!$GNULIB_PRINTF_POSIX$ac_delim -GNULIB_SNPRINTF!$GNULIB_SNPRINTF$ac_delim -GNULIB_SPRINTF_POSIX!$GNULIB_SPRINTF_POSIX$ac_delim -GNULIB_VFPRINTF_POSIX!$GNULIB_VFPRINTF_POSIX$ac_delim -GNULIB_VPRINTF_POSIX!$GNULIB_VPRINTF_POSIX$ac_delim -GNULIB_VSNPRINTF!$GNULIB_VSNPRINTF$ac_delim -GNULIB_VSPRINTF_POSIX!$GNULIB_VSPRINTF_POSIX$ac_delim -GNULIB_VASPRINTF!$GNULIB_VASPRINTF$ac_delim -GNULIB_FOPEN!$GNULIB_FOPEN$ac_delim -GNULIB_FREOPEN!$GNULIB_FREOPEN$ac_delim -GNULIB_FSEEK!$GNULIB_FSEEK$ac_delim -GNULIB_FSEEKO!$GNULIB_FSEEKO$ac_delim -GNULIB_FTELL!$GNULIB_FTELL$ac_delim -GNULIB_FTELLO!$GNULIB_FTELLO$ac_delim -GNULIB_FFLUSH!$GNULIB_FFLUSH$ac_delim -GNULIB_GETDELIM!$GNULIB_GETDELIM$ac_delim -GNULIB_GETLINE!$GNULIB_GETLINE$ac_delim -REPLACE_FPRINTF!$REPLACE_FPRINTF$ac_delim -REPLACE_VFPRINTF!$REPLACE_VFPRINTF$ac_delim -REPLACE_PRINTF!$REPLACE_PRINTF$ac_delim -REPLACE_VPRINTF!$REPLACE_VPRINTF$ac_delim -REPLACE_SNPRINTF!$REPLACE_SNPRINTF$ac_delim -HAVE_DECL_SNPRINTF!$HAVE_DECL_SNPRINTF$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -48271,103 +56789,103 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -REPLACE_VSNPRINTF!$REPLACE_VSNPRINTF$ac_delim -HAVE_DECL_VSNPRINTF!$HAVE_DECL_VSNPRINTF$ac_delim -REPLACE_SPRINTF!$REPLACE_SPRINTF$ac_delim -REPLACE_VSPRINTF!$REPLACE_VSPRINTF$ac_delim -HAVE_VASPRINTF!$HAVE_VASPRINTF$ac_delim -REPLACE_VASPRINTF!$REPLACE_VASPRINTF$ac_delim -REPLACE_FOPEN!$REPLACE_FOPEN$ac_delim -REPLACE_FREOPEN!$REPLACE_FREOPEN$ac_delim -HAVE_FSEEKO!$HAVE_FSEEKO$ac_delim -REPLACE_FSEEKO!$REPLACE_FSEEKO$ac_delim -REPLACE_FSEEK!$REPLACE_FSEEK$ac_delim -HAVE_FTELLO!$HAVE_FTELLO$ac_delim -REPLACE_FTELLO!$REPLACE_FTELLO$ac_delim -REPLACE_FTELL!$REPLACE_FTELL$ac_delim -REPLACE_FFLUSH!$REPLACE_FFLUSH$ac_delim -HAVE_DECL_GETDELIM!$HAVE_DECL_GETDELIM$ac_delim -HAVE_DECL_GETLINE!$HAVE_DECL_GETLINE$ac_delim -REPLACE_GETLINE!$REPLACE_GETLINE$ac_delim -STDBOOL_H!$STDBOOL_H$ac_delim -HAVE__BOOL!$HAVE__BOOL$ac_delim -HAVE_LONG_LONG_INT!$HAVE_LONG_LONG_INT$ac_delim -HAVE_UNSIGNED_LONG_LONG_INT!$HAVE_UNSIGNED_LONG_LONG_INT$ac_delim -HAVE_INTTYPES_H!$HAVE_INTTYPES_H$ac_delim -HAVE_SYS_TYPES_H!$HAVE_SYS_TYPES_H$ac_delim -NEXT_STDINT_H!$NEXT_STDINT_H$ac_delim -HAVE_STDINT_H!$HAVE_STDINT_H$ac_delim -HAVE_SYS_INTTYPES_H!$HAVE_SYS_INTTYPES_H$ac_delim -HAVE_SYS_BITYPES_H!$HAVE_SYS_BITYPES_H$ac_delim -BITSIZEOF_PTRDIFF_T!$BITSIZEOF_PTRDIFF_T$ac_delim -BITSIZEOF_SIG_ATOMIC_T!$BITSIZEOF_SIG_ATOMIC_T$ac_delim -BITSIZEOF_SIZE_T!$BITSIZEOF_SIZE_T$ac_delim -BITSIZEOF_WCHAR_T!$BITSIZEOF_WCHAR_T$ac_delim -BITSIZEOF_WINT_T!$BITSIZEOF_WINT_T$ac_delim -HAVE_SIGNED_SIG_ATOMIC_T!$HAVE_SIGNED_SIG_ATOMIC_T$ac_delim -HAVE_SIGNED_WCHAR_T!$HAVE_SIGNED_WCHAR_T$ac_delim -HAVE_SIGNED_WINT_T!$HAVE_SIGNED_WINT_T$ac_delim -PTRDIFF_T_SUFFIX!$PTRDIFF_T_SUFFIX$ac_delim -SIG_ATOMIC_T_SUFFIX!$SIG_ATOMIC_T_SUFFIX$ac_delim -SIZE_T_SUFFIX!$SIZE_T_SUFFIX$ac_delim -WCHAR_T_SUFFIX!$WCHAR_T_SUFFIX$ac_delim -WINT_T_SUFFIX!$WINT_T_SUFFIX$ac_delim -STDINT_H!$STDINT_H$ac_delim -NEXT_STDIO_H!$NEXT_STDIO_H$ac_delim -NEXT_STDLIB_H!$NEXT_STDLIB_H$ac_delim -GNULIB_MEMMEM!$GNULIB_MEMMEM$ac_delim -GNULIB_MEMPCPY!$GNULIB_MEMPCPY$ac_delim -GNULIB_MEMRCHR!$GNULIB_MEMRCHR$ac_delim -GNULIB_STPCPY!$GNULIB_STPCPY$ac_delim -GNULIB_STPNCPY!$GNULIB_STPNCPY$ac_delim -GNULIB_STRCHRNUL!$GNULIB_STRCHRNUL$ac_delim -GNULIB_STRDUP!$GNULIB_STRDUP$ac_delim -GNULIB_STRNDUP!$GNULIB_STRNDUP$ac_delim -GNULIB_STRNLEN!$GNULIB_STRNLEN$ac_delim -GNULIB_STRPBRK!$GNULIB_STRPBRK$ac_delim -GNULIB_STRSEP!$GNULIB_STRSEP$ac_delim -GNULIB_STRSTR!$GNULIB_STRSTR$ac_delim -GNULIB_STRCASESTR!$GNULIB_STRCASESTR$ac_delim -GNULIB_STRTOK_R!$GNULIB_STRTOK_R$ac_delim -GNULIB_MBSLEN!$GNULIB_MBSLEN$ac_delim -GNULIB_MBSNLEN!$GNULIB_MBSNLEN$ac_delim -GNULIB_MBSCHR!$GNULIB_MBSCHR$ac_delim -GNULIB_MBSRCHR!$GNULIB_MBSRCHR$ac_delim -GNULIB_MBSSTR!$GNULIB_MBSSTR$ac_delim -GNULIB_MBSCASECMP!$GNULIB_MBSCASECMP$ac_delim -GNULIB_MBSNCASECMP!$GNULIB_MBSNCASECMP$ac_delim -GNULIB_MBSPCASECMP!$GNULIB_MBSPCASECMP$ac_delim -GNULIB_MBSCASESTR!$GNULIB_MBSCASESTR$ac_delim -GNULIB_MBSCSPN!$GNULIB_MBSCSPN$ac_delim -GNULIB_MBSPBRK!$GNULIB_MBSPBRK$ac_delim -GNULIB_MBSSPN!$GNULIB_MBSSPN$ac_delim -GNULIB_MBSSEP!$GNULIB_MBSSEP$ac_delim -GNULIB_MBSTOK_R!$GNULIB_MBSTOK_R$ac_delim -GNULIB_STRERROR!$GNULIB_STRERROR$ac_delim -GNULIB_STRSIGNAL!$GNULIB_STRSIGNAL$ac_delim -HAVE_DECL_MEMMEM!$HAVE_DECL_MEMMEM$ac_delim -HAVE_MEMPCPY!$HAVE_MEMPCPY$ac_delim -HAVE_DECL_MEMRCHR!$HAVE_DECL_MEMRCHR$ac_delim -HAVE_STPCPY!$HAVE_STPCPY$ac_delim -HAVE_STPNCPY!$HAVE_STPNCPY$ac_delim -HAVE_STRCHRNUL!$HAVE_STRCHRNUL$ac_delim -HAVE_DECL_STRDUP!$HAVE_DECL_STRDUP$ac_delim -HAVE_STRNDUP!$HAVE_STRNDUP$ac_delim -HAVE_DECL_STRNDUP!$HAVE_DECL_STRNDUP$ac_delim -HAVE_DECL_STRNLEN!$HAVE_DECL_STRNLEN$ac_delim -HAVE_STRPBRK!$HAVE_STRPBRK$ac_delim -HAVE_STRSEP!$HAVE_STRSEP$ac_delim -HAVE_STRCASESTR!$HAVE_STRCASESTR$ac_delim -HAVE_DECL_STRTOK_R!$HAVE_DECL_STRTOK_R$ac_delim -HAVE_DECL_STRERROR!$HAVE_DECL_STRERROR$ac_delim -HAVE_DECL_STRSIGNAL!$HAVE_DECL_STRSIGNAL$ac_delim -REPLACE_STRERROR!$REPLACE_STRERROR$ac_delim -REPLACE_STRSIGNAL!$REPLACE_STRSIGNAL$ac_delim -REPLACE_MEMMEM!$REPLACE_MEMMEM$ac_delim -REPLACE_STRCASESTR!$REPLACE_STRCASESTR$ac_delim -REPLACE_STRSTR!$REPLACE_STRSTR$ac_delim -NEXT_STRING_H!$NEXT_STRING_H$ac_delim +REPLACE_FREXPL!$REPLACE_FREXPL$ac_delim +REPLACE_HUGE_VAL!$REPLACE_HUGE_VAL$ac_delim +REPLACE_ISFINITE!$REPLACE_ISFINITE$ac_delim +REPLACE_ISINF!$REPLACE_ISINF$ac_delim +REPLACE_ISNAN!$REPLACE_ISNAN$ac_delim +REPLACE_LDEXPL!$REPLACE_LDEXPL$ac_delim +REPLACE_NAN!$REPLACE_NAN$ac_delim +REPLACE_ROUND!$REPLACE_ROUND$ac_delim +REPLACE_ROUNDF!$REPLACE_ROUNDF$ac_delim +REPLACE_ROUNDL!$REPLACE_ROUNDL$ac_delim +REPLACE_SIGNBIT!$REPLACE_SIGNBIT$ac_delim +REPLACE_SIGNBIT_USING_GCC!$REPLACE_SIGNBIT_USING_GCC$ac_delim +REPLACE_TRUNCL!$REPLACE_TRUNCL$ac_delim +FLOORF_LIBM!$FLOORF_LIBM$ac_delim +GNULIB_SOCKET!$GNULIB_SOCKET$ac_delim +GNULIB_CONNECT!$GNULIB_CONNECT$ac_delim +GNULIB_ACCEPT!$GNULIB_ACCEPT$ac_delim +GNULIB_BIND!$GNULIB_BIND$ac_delim +GNULIB_GETPEERNAME!$GNULIB_GETPEERNAME$ac_delim +GNULIB_GETSOCKNAME!$GNULIB_GETSOCKNAME$ac_delim +GNULIB_GETSOCKOPT!$GNULIB_GETSOCKOPT$ac_delim +GNULIB_LISTEN!$GNULIB_LISTEN$ac_delim +GNULIB_RECV!$GNULIB_RECV$ac_delim +GNULIB_SEND!$GNULIB_SEND$ac_delim +GNULIB_RECVFROM!$GNULIB_RECVFROM$ac_delim +GNULIB_SENDTO!$GNULIB_SENDTO$ac_delim +GNULIB_SETSOCKOPT!$GNULIB_SETSOCKOPT$ac_delim +GNULIB_SHUTDOWN!$GNULIB_SHUTDOWN$ac_delim +HAVE_STRUCT_SOCKADDR_STORAGE!$HAVE_STRUCT_SOCKADDR_STORAGE$ac_delim +NEXT_SYS_SOCKET_H!$NEXT_SYS_SOCKET_H$ac_delim +HAVE_SYS_SOCKET_H!$HAVE_SYS_SOCKET_H$ac_delim +HAVE_WS2TCPIP_H!$HAVE_WS2TCPIP_H$ac_delim GNULIB_CHOWN!$GNULIB_CHOWN$ac_delim +GNULIB_CLOSE!$GNULIB_CLOSE$ac_delim +GNULIB_DUP2!$GNULIB_DUP2$ac_delim +GNULIB_ENVIRON!$GNULIB_ENVIRON$ac_delim +GNULIB_EUIDACCESS!$GNULIB_EUIDACCESS$ac_delim +GNULIB_FCHDIR!$GNULIB_FCHDIR$ac_delim +GNULIB_FSYNC!$GNULIB_FSYNC$ac_delim +GNULIB_FTRUNCATE!$GNULIB_FTRUNCATE$ac_delim +GNULIB_GETCWD!$GNULIB_GETCWD$ac_delim +GNULIB_GETDOMAINNAME!$GNULIB_GETDOMAINNAME$ac_delim +GNULIB_GETDTABLESIZE!$GNULIB_GETDTABLESIZE$ac_delim +GNULIB_GETHOSTNAME!$GNULIB_GETHOSTNAME$ac_delim +GNULIB_GETLOGIN_R!$GNULIB_GETLOGIN_R$ac_delim +GNULIB_GETPAGESIZE!$GNULIB_GETPAGESIZE$ac_delim +GNULIB_GETUSERSHELL!$GNULIB_GETUSERSHELL$ac_delim +GNULIB_LCHOWN!$GNULIB_LCHOWN$ac_delim +GNULIB_LINK!$GNULIB_LINK$ac_delim +GNULIB_LSEEK!$GNULIB_LSEEK$ac_delim +GNULIB_READLINK!$GNULIB_READLINK$ac_delim +GNULIB_SLEEP!$GNULIB_SLEEP$ac_delim +GNULIB_UNISTD_H_SIGPIPE!$GNULIB_UNISTD_H_SIGPIPE$ac_delim +GNULIB_WRITE!$GNULIB_WRITE$ac_delim +HAVE_DUP2!$HAVE_DUP2$ac_delim +HAVE_EUIDACCESS!$HAVE_EUIDACCESS$ac_delim +HAVE_FSYNC!$HAVE_FSYNC$ac_delim +HAVE_FTRUNCATE!$HAVE_FTRUNCATE$ac_delim +HAVE_GETDOMAINNAME!$HAVE_GETDOMAINNAME$ac_delim +HAVE_GETDTABLESIZE!$HAVE_GETDTABLESIZE$ac_delim +HAVE_GETHOSTNAME!$HAVE_GETHOSTNAME$ac_delim +HAVE_GETPAGESIZE!$HAVE_GETPAGESIZE$ac_delim +HAVE_GETUSERSHELL!$HAVE_GETUSERSHELL$ac_delim +HAVE_LINK!$HAVE_LINK$ac_delim +HAVE_READLINK!$HAVE_READLINK$ac_delim +HAVE_SLEEP!$HAVE_SLEEP$ac_delim +HAVE_DECL_ENVIRON!$HAVE_DECL_ENVIRON$ac_delim +HAVE_DECL_GETLOGIN_R!$HAVE_DECL_GETLOGIN_R$ac_delim +HAVE_OS_H!$HAVE_OS_H$ac_delim +HAVE_SYS_PARAM_H!$HAVE_SYS_PARAM_H$ac_delim +REPLACE_CHOWN!$REPLACE_CHOWN$ac_delim +REPLACE_CLOSE!$REPLACE_CLOSE$ac_delim +REPLACE_FCHDIR!$REPLACE_FCHDIR$ac_delim +REPLACE_GETCWD!$REPLACE_GETCWD$ac_delim +REPLACE_GETPAGESIZE!$REPLACE_GETPAGESIZE$ac_delim +REPLACE_LCHOWN!$REPLACE_LCHOWN$ac_delim +REPLACE_LSEEK!$REPLACE_LSEEK$ac_delim +REPLACE_WRITE!$REPLACE_WRITE$ac_delim +UNISTD_H_HAVE_WINSOCK2_H!$UNISTD_H_HAVE_WINSOCK2_H$ac_delim +HAVE_WINSOCK2_H!$HAVE_WINSOCK2_H$ac_delim +SYS_SOCKET_H!$SYS_SOCKET_H$ac_delim +GNULIB_GETADDRINFO!$GNULIB_GETADDRINFO$ac_delim +HAVE_STRUCT_ADDRINFO!$HAVE_STRUCT_ADDRINFO$ac_delim +HAVE_DECL_FREEADDRINFO!$HAVE_DECL_FREEADDRINFO$ac_delim +HAVE_DECL_GAI_STRERROR!$HAVE_DECL_GAI_STRERROR$ac_delim +HAVE_DECL_GETADDRINFO!$HAVE_DECL_GETADDRINFO$ac_delim +HAVE_DECL_GETNAMEINFO!$HAVE_DECL_GETNAMEINFO$ac_delim +NEXT_NETDB_H!$NEXT_NETDB_H$ac_delim +HAVE_NETDB_H!$HAVE_NETDB_H$ac_delim +NETDB_H!$NETDB_H$ac_delim +HOSTENT_LIB!$HOSTENT_LIB$ac_delim +SERVENT_LIB!$SERVENT_LIB$ac_delim +GETADDRINFO_LIB!$GETADDRINFO_LIB$ac_delim +GNULIB_MALLOC_POSIX!$GNULIB_MALLOC_POSIX$ac_delim +GNULIB_REALLOC_POSIX!$GNULIB_REALLOC_POSIX$ac_delim +GNULIB_CALLOC_POSIX!$GNULIB_CALLOC_POSIX$ac_delim +GNULIB_ATOLL!$GNULIB_ATOLL$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -48409,54 +56927,106 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -GNULIB_DUP2!$GNULIB_DUP2$ac_delim -GNULIB_FCHDIR!$GNULIB_FCHDIR$ac_delim -GNULIB_FTRUNCATE!$GNULIB_FTRUNCATE$ac_delim -GNULIB_GETCWD!$GNULIB_GETCWD$ac_delim -GNULIB_GETLOGIN_R!$GNULIB_GETLOGIN_R$ac_delim -GNULIB_GETPAGESIZE!$GNULIB_GETPAGESIZE$ac_delim -GNULIB_LCHOWN!$GNULIB_LCHOWN$ac_delim -GNULIB_LSEEK!$GNULIB_LSEEK$ac_delim -GNULIB_READLINK!$GNULIB_READLINK$ac_delim -GNULIB_SLEEP!$GNULIB_SLEEP$ac_delim -HAVE_DUP2!$HAVE_DUP2$ac_delim -HAVE_FTRUNCATE!$HAVE_FTRUNCATE$ac_delim -HAVE_GETPAGESIZE!$HAVE_GETPAGESIZE$ac_delim -HAVE_READLINK!$HAVE_READLINK$ac_delim -HAVE_SLEEP!$HAVE_SLEEP$ac_delim -HAVE_DECL_GETLOGIN_R!$HAVE_DECL_GETLOGIN_R$ac_delim -HAVE_OS_H!$HAVE_OS_H$ac_delim -HAVE_SYS_PARAM_H!$HAVE_SYS_PARAM_H$ac_delim -REPLACE_CHOWN!$REPLACE_CHOWN$ac_delim -REPLACE_FCHDIR!$REPLACE_FCHDIR$ac_delim -REPLACE_GETCWD!$REPLACE_GETCWD$ac_delim -REPLACE_GETPAGESIZE!$REPLACE_GETPAGESIZE$ac_delim -REPLACE_LCHOWN!$REPLACE_LCHOWN$ac_delim -REPLACE_LSEEK!$REPLACE_LSEEK$ac_delim -NEXT_UNISTD_H!$NEXT_UNISTD_H$ac_delim -HAVE_UNISTD_H!$HAVE_UNISTD_H$ac_delim -EOVERFLOW!$EOVERFLOW$ac_delim -GNULIB_WCWIDTH!$GNULIB_WCWIDTH$ac_delim -HAVE_DECL_WCWIDTH!$HAVE_DECL_WCWIDTH$ac_delim -REPLACE_WCWIDTH!$REPLACE_WCWIDTH$ac_delim -WCHAR_H!$WCHAR_H$ac_delim -HAVE_WCHAR_H!$HAVE_WCHAR_H$ac_delim -NEXT_WCHAR_H!$NEXT_WCHAR_H$ac_delim -HAVE_ISWCNTRL!$HAVE_ISWCNTRL$ac_delim -HAVE_WINT_T!$HAVE_WINT_T$ac_delim -NEXT_WCTYPE_H!$NEXT_WCTYPE_H$ac_delim -HAVE_WCTYPE_H!$HAVE_WCTYPE_H$ac_delim -WCTYPE_H!$WCTYPE_H$ac_delim -LIBGNU_LIBDEPS!$LIBGNU_LIBDEPS$ac_delim -LIBGNU_LTLIBDEPS!$LIBGNU_LTLIBDEPS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -gl_LIBOBJS!$gl_LIBOBJS$ac_delim -gl_LTLIBOBJS!$gl_LTLIBOBJS$ac_delim -gltests_LIBOBJS!$gltests_LIBOBJS$ac_delim -gltests_LTLIBOBJS!$gltests_LTLIBOBJS$ac_delim +GNULIB_GETLOADAVG!$GNULIB_GETLOADAVG$ac_delim +GNULIB_GETSUBOPT!$GNULIB_GETSUBOPT$ac_delim +GNULIB_MKDTEMP!$GNULIB_MKDTEMP$ac_delim +GNULIB_MKSTEMP!$GNULIB_MKSTEMP$ac_delim +GNULIB_PUTENV!$GNULIB_PUTENV$ac_delim +GNULIB_RANDOM_R!$GNULIB_RANDOM_R$ac_delim +GNULIB_RPMATCH!$GNULIB_RPMATCH$ac_delim +GNULIB_SETENV!$GNULIB_SETENV$ac_delim +GNULIB_STRTOD!$GNULIB_STRTOD$ac_delim +GNULIB_STRTOLL!$GNULIB_STRTOLL$ac_delim +GNULIB_STRTOULL!$GNULIB_STRTOULL$ac_delim +GNULIB_UNSETENV!$GNULIB_UNSETENV$ac_delim +HAVE_ATOLL!$HAVE_ATOLL$ac_delim +HAVE_CALLOC_POSIX!$HAVE_CALLOC_POSIX$ac_delim +HAVE_GETSUBOPT!$HAVE_GETSUBOPT$ac_delim +HAVE_MALLOC_POSIX!$HAVE_MALLOC_POSIX$ac_delim +HAVE_MKDTEMP!$HAVE_MKDTEMP$ac_delim +HAVE_REALLOC_POSIX!$HAVE_REALLOC_POSIX$ac_delim +HAVE_RANDOM_R!$HAVE_RANDOM_R$ac_delim +HAVE_RPMATCH!$HAVE_RPMATCH$ac_delim +HAVE_SETENV!$HAVE_SETENV$ac_delim +HAVE_STRTOD!$HAVE_STRTOD$ac_delim +HAVE_STRTOLL!$HAVE_STRTOLL$ac_delim +HAVE_STRTOULL!$HAVE_STRTOULL$ac_delim +HAVE_STRUCT_RANDOM_DATA!$HAVE_STRUCT_RANDOM_DATA$ac_delim +HAVE_SYS_LOADAVG_H!$HAVE_SYS_LOADAVG_H$ac_delim +HAVE_UNSETENV!$HAVE_UNSETENV$ac_delim +HAVE_DECL_GETLOADAVG!$HAVE_DECL_GETLOADAVG$ac_delim +REPLACE_MKSTEMP!$REPLACE_MKSTEMP$ac_delim +REPLACE_PUTENV!$REPLACE_PUTENV$ac_delim +REPLACE_STRTOD!$REPLACE_STRTOD$ac_delim +VOID_UNSETENV!$VOID_UNSETENV$ac_delim +NEED_SETGID!$NEED_SETGID$ac_delim +KMEM_GROUP!$KMEM_GROUP$ac_delim +GETLOADAVG_LIBS!$GETLOADAVG_LIBS$ac_delim +GETOPT_H!$GETOPT_H$ac_delim +GLIBC21!$GLIBC21$ac_delim +LOCALCHARSET_TESTS_ENVIRONMENT!$LOCALCHARSET_TESTS_ENVIRONMENT$ac_delim +NEXT_MATH_H!$NEXT_MATH_H$ac_delim +LOCALE_JA!$LOCALE_JA$ac_delim +LOCALE_ZH_CN!$LOCALE_ZH_CN$ac_delim +LOCALE_FR_UTF8!$LOCALE_FR_UTF8$ac_delim +APPLE_UNIVERSAL_BUILD!$APPLE_UNIVERSAL_BUILD$ac_delim +NEXT_NETINET_IN_H!$NEXT_NETINET_IN_H$ac_delim +HAVE_NETINET_IN_H!$HAVE_NETINET_IN_H$ac_delim +NETINET_IN_H!$NETINET_IN_H$ac_delim +GNULIB_FPRINTF!$GNULIB_FPRINTF$ac_delim +GNULIB_FPRINTF_POSIX!$GNULIB_FPRINTF_POSIX$ac_delim +GNULIB_PRINTF!$GNULIB_PRINTF$ac_delim +GNULIB_PRINTF_POSIX!$GNULIB_PRINTF_POSIX$ac_delim +GNULIB_SNPRINTF!$GNULIB_SNPRINTF$ac_delim +GNULIB_SPRINTF_POSIX!$GNULIB_SPRINTF_POSIX$ac_delim +GNULIB_VFPRINTF!$GNULIB_VFPRINTF$ac_delim +GNULIB_VFPRINTF_POSIX!$GNULIB_VFPRINTF_POSIX$ac_delim +GNULIB_VPRINTF!$GNULIB_VPRINTF$ac_delim +GNULIB_VPRINTF_POSIX!$GNULIB_VPRINTF_POSIX$ac_delim +GNULIB_VSNPRINTF!$GNULIB_VSNPRINTF$ac_delim +GNULIB_VSPRINTF_POSIX!$GNULIB_VSPRINTF_POSIX$ac_delim +GNULIB_DPRINTF!$GNULIB_DPRINTF$ac_delim +GNULIB_VDPRINTF!$GNULIB_VDPRINTF$ac_delim +GNULIB_VASPRINTF!$GNULIB_VASPRINTF$ac_delim +GNULIB_OBSTACK_PRINTF!$GNULIB_OBSTACK_PRINTF$ac_delim +GNULIB_OBSTACK_PRINTF_POSIX!$GNULIB_OBSTACK_PRINTF_POSIX$ac_delim +GNULIB_FOPEN!$GNULIB_FOPEN$ac_delim +GNULIB_FREOPEN!$GNULIB_FREOPEN$ac_delim +GNULIB_FSEEK!$GNULIB_FSEEK$ac_delim +GNULIB_FSEEKO!$GNULIB_FSEEKO$ac_delim +GNULIB_FTELL!$GNULIB_FTELL$ac_delim +GNULIB_FTELLO!$GNULIB_FTELLO$ac_delim +GNULIB_FFLUSH!$GNULIB_FFLUSH$ac_delim +GNULIB_FCLOSE!$GNULIB_FCLOSE$ac_delim +GNULIB_FPUTC!$GNULIB_FPUTC$ac_delim +GNULIB_PUTC!$GNULIB_PUTC$ac_delim +GNULIB_PUTCHAR!$GNULIB_PUTCHAR$ac_delim +GNULIB_FPUTS!$GNULIB_FPUTS$ac_delim +GNULIB_PUTS!$GNULIB_PUTS$ac_delim +GNULIB_FWRITE!$GNULIB_FWRITE$ac_delim +GNULIB_GETDELIM!$GNULIB_GETDELIM$ac_delim +GNULIB_GETLINE!$GNULIB_GETLINE$ac_delim +GNULIB_PERROR!$GNULIB_PERROR$ac_delim +GNULIB_STDIO_H_SIGPIPE!$GNULIB_STDIO_H_SIGPIPE$ac_delim +REPLACE_STDIO_WRITE_FUNCS!$REPLACE_STDIO_WRITE_FUNCS$ac_delim +REPLACE_FPRINTF!$REPLACE_FPRINTF$ac_delim +REPLACE_VFPRINTF!$REPLACE_VFPRINTF$ac_delim +REPLACE_PRINTF!$REPLACE_PRINTF$ac_delim +REPLACE_VPRINTF!$REPLACE_VPRINTF$ac_delim +REPLACE_SNPRINTF!$REPLACE_SNPRINTF$ac_delim +HAVE_DECL_SNPRINTF!$HAVE_DECL_SNPRINTF$ac_delim +REPLACE_VSNPRINTF!$REPLACE_VSNPRINTF$ac_delim +HAVE_DECL_VSNPRINTF!$HAVE_DECL_VSNPRINTF$ac_delim +REPLACE_SPRINTF!$REPLACE_SPRINTF$ac_delim +REPLACE_VSPRINTF!$REPLACE_VSPRINTF$ac_delim +HAVE_DPRINTF!$HAVE_DPRINTF$ac_delim +REPLACE_DPRINTF!$REPLACE_DPRINTF$ac_delim +HAVE_VDPRINTF!$HAVE_VDPRINTF$ac_delim +REPLACE_VDPRINTF!$REPLACE_VDPRINTF$ac_delim +HAVE_VASPRINTF!$HAVE_VASPRINTF$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 45; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -48475,6 +57045,213 @@ fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-5.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +REPLACE_VASPRINTF!$REPLACE_VASPRINTF$ac_delim +HAVE_DECL_OBSTACK_PRINTF!$HAVE_DECL_OBSTACK_PRINTF$ac_delim +REPLACE_OBSTACK_PRINTF!$REPLACE_OBSTACK_PRINTF$ac_delim +REPLACE_FOPEN!$REPLACE_FOPEN$ac_delim +REPLACE_FREOPEN!$REPLACE_FREOPEN$ac_delim +HAVE_FSEEKO!$HAVE_FSEEKO$ac_delim +REPLACE_FSEEKO!$REPLACE_FSEEKO$ac_delim +REPLACE_FSEEK!$REPLACE_FSEEK$ac_delim +HAVE_FTELLO!$HAVE_FTELLO$ac_delim +REPLACE_FTELLO!$REPLACE_FTELLO$ac_delim +REPLACE_FTELL!$REPLACE_FTELL$ac_delim +REPLACE_FFLUSH!$REPLACE_FFLUSH$ac_delim +REPLACE_FCLOSE!$REPLACE_FCLOSE$ac_delim +HAVE_DECL_GETDELIM!$HAVE_DECL_GETDELIM$ac_delim +HAVE_DECL_GETLINE!$HAVE_DECL_GETLINE$ac_delim +REPLACE_GETLINE!$REPLACE_GETLINE$ac_delim +REPLACE_PERROR!$REPLACE_PERROR$ac_delim +STDBOOL_H!$STDBOOL_H$ac_delim +HAVE__BOOL!$HAVE__BOOL$ac_delim +HAVE_LONG_LONG_INT!$HAVE_LONG_LONG_INT$ac_delim +HAVE_UNSIGNED_LONG_LONG_INT!$HAVE_UNSIGNED_LONG_LONG_INT$ac_delim +HAVE_INTTYPES_H!$HAVE_INTTYPES_H$ac_delim +HAVE_SYS_TYPES_H!$HAVE_SYS_TYPES_H$ac_delim +NEXT_STDINT_H!$NEXT_STDINT_H$ac_delim +HAVE_STDINT_H!$HAVE_STDINT_H$ac_delim +HAVE_SYS_INTTYPES_H!$HAVE_SYS_INTTYPES_H$ac_delim +HAVE_SYS_BITYPES_H!$HAVE_SYS_BITYPES_H$ac_delim +BITSIZEOF_PTRDIFF_T!$BITSIZEOF_PTRDIFF_T$ac_delim +BITSIZEOF_SIZE_T!$BITSIZEOF_SIZE_T$ac_delim +BITSIZEOF_SIG_ATOMIC_T!$BITSIZEOF_SIG_ATOMIC_T$ac_delim +BITSIZEOF_WCHAR_T!$BITSIZEOF_WCHAR_T$ac_delim +BITSIZEOF_WINT_T!$BITSIZEOF_WINT_T$ac_delim +HAVE_SIGNED_SIG_ATOMIC_T!$HAVE_SIGNED_SIG_ATOMIC_T$ac_delim +HAVE_SIGNED_WCHAR_T!$HAVE_SIGNED_WCHAR_T$ac_delim +HAVE_SIGNED_WINT_T!$HAVE_SIGNED_WINT_T$ac_delim +PTRDIFF_T_SUFFIX!$PTRDIFF_T_SUFFIX$ac_delim +SIZE_T_SUFFIX!$SIZE_T_SUFFIX$ac_delim +SIG_ATOMIC_T_SUFFIX!$SIG_ATOMIC_T_SUFFIX$ac_delim +WCHAR_T_SUFFIX!$WCHAR_T_SUFFIX$ac_delim +WINT_T_SUFFIX!$WINT_T_SUFFIX$ac_delim +STDINT_H!$STDINT_H$ac_delim +NEXT_STDIO_H!$NEXT_STDIO_H$ac_delim +NEXT_STDLIB_H!$NEXT_STDLIB_H$ac_delim +HAVE_RANDOM_H!$HAVE_RANDOM_H$ac_delim +GNULIB_MEMMEM!$GNULIB_MEMMEM$ac_delim +GNULIB_MEMPCPY!$GNULIB_MEMPCPY$ac_delim +GNULIB_MEMRCHR!$GNULIB_MEMRCHR$ac_delim +GNULIB_RAWMEMCHR!$GNULIB_RAWMEMCHR$ac_delim +GNULIB_STPCPY!$GNULIB_STPCPY$ac_delim +GNULIB_STPNCPY!$GNULIB_STPNCPY$ac_delim +GNULIB_STRCHRNUL!$GNULIB_STRCHRNUL$ac_delim +GNULIB_STRDUP!$GNULIB_STRDUP$ac_delim +GNULIB_STRNDUP!$GNULIB_STRNDUP$ac_delim +GNULIB_STRNLEN!$GNULIB_STRNLEN$ac_delim +GNULIB_STRPBRK!$GNULIB_STRPBRK$ac_delim +GNULIB_STRSEP!$GNULIB_STRSEP$ac_delim +GNULIB_STRSTR!$GNULIB_STRSTR$ac_delim +GNULIB_STRCASESTR!$GNULIB_STRCASESTR$ac_delim +GNULIB_STRTOK_R!$GNULIB_STRTOK_R$ac_delim +GNULIB_MBSLEN!$GNULIB_MBSLEN$ac_delim +GNULIB_MBSNLEN!$GNULIB_MBSNLEN$ac_delim +GNULIB_MBSCHR!$GNULIB_MBSCHR$ac_delim +GNULIB_MBSRCHR!$GNULIB_MBSRCHR$ac_delim +GNULIB_MBSSTR!$GNULIB_MBSSTR$ac_delim +GNULIB_MBSCASECMP!$GNULIB_MBSCASECMP$ac_delim +GNULIB_MBSNCASECMP!$GNULIB_MBSNCASECMP$ac_delim +GNULIB_MBSPCASECMP!$GNULIB_MBSPCASECMP$ac_delim +GNULIB_MBSCASESTR!$GNULIB_MBSCASESTR$ac_delim +GNULIB_MBSCSPN!$GNULIB_MBSCSPN$ac_delim +GNULIB_MBSPBRK!$GNULIB_MBSPBRK$ac_delim +GNULIB_MBSSPN!$GNULIB_MBSSPN$ac_delim +GNULIB_MBSSEP!$GNULIB_MBSSEP$ac_delim +GNULIB_MBSTOK_R!$GNULIB_MBSTOK_R$ac_delim +GNULIB_STRERROR!$GNULIB_STRERROR$ac_delim +GNULIB_STRSIGNAL!$GNULIB_STRSIGNAL$ac_delim +GNULIB_STRVERSCMP!$GNULIB_STRVERSCMP$ac_delim +HAVE_DECL_MEMMEM!$HAVE_DECL_MEMMEM$ac_delim +HAVE_MEMPCPY!$HAVE_MEMPCPY$ac_delim +HAVE_DECL_MEMRCHR!$HAVE_DECL_MEMRCHR$ac_delim +HAVE_RAWMEMCHR!$HAVE_RAWMEMCHR$ac_delim +HAVE_STPCPY!$HAVE_STPCPY$ac_delim +HAVE_STPNCPY!$HAVE_STPNCPY$ac_delim +HAVE_STRCHRNUL!$HAVE_STRCHRNUL$ac_delim +HAVE_DECL_STRDUP!$HAVE_DECL_STRDUP$ac_delim +HAVE_STRNDUP!$HAVE_STRNDUP$ac_delim +HAVE_DECL_STRNDUP!$HAVE_DECL_STRNDUP$ac_delim +HAVE_DECL_STRNLEN!$HAVE_DECL_STRNLEN$ac_delim +HAVE_STRPBRK!$HAVE_STRPBRK$ac_delim +HAVE_STRSEP!$HAVE_STRSEP$ac_delim +HAVE_STRCASESTR!$HAVE_STRCASESTR$ac_delim +HAVE_DECL_STRTOK_R!$HAVE_DECL_STRTOK_R$ac_delim +HAVE_DECL_STRERROR!$HAVE_DECL_STRERROR$ac_delim +HAVE_DECL_STRSIGNAL!$HAVE_DECL_STRSIGNAL$ac_delim +HAVE_STRVERSCMP!$HAVE_STRVERSCMP$ac_delim +REPLACE_MEMMEM!$REPLACE_MEMMEM$ac_delim +REPLACE_STRDUP!$REPLACE_STRDUP$ac_delim +REPLACE_STRSTR!$REPLACE_STRSTR$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-6.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +REPLACE_STRCASESTR!$REPLACE_STRCASESTR$ac_delim +REPLACE_STRERROR!$REPLACE_STRERROR$ac_delim +REPLACE_STRSIGNAL!$REPLACE_STRSIGNAL$ac_delim +NEXT_STRING_H!$NEXT_STRING_H$ac_delim +REPLACE_LOCALTIME_R!$REPLACE_LOCALTIME_R$ac_delim +REPLACE_NANOSLEEP!$REPLACE_NANOSLEEP$ac_delim +REPLACE_STRPTIME!$REPLACE_STRPTIME$ac_delim +REPLACE_TIMEGM!$REPLACE_TIMEGM$ac_delim +NEXT_TIME_H!$NEXT_TIME_H$ac_delim +TIME_H_DEFINES_STRUCT_TIMESPEC!$TIME_H_DEFINES_STRUCT_TIMESPEC$ac_delim +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC!$SYS_TIME_H_DEFINES_STRUCT_TIMESPEC$ac_delim +NEXT_UNISTD_H!$NEXT_UNISTD_H$ac_delim +HAVE_UNISTD_H!$HAVE_UNISTD_H$ac_delim +HAVE_WINT_T!$HAVE_WINT_T$ac_delim +HAVE_WCHAR_H!$HAVE_WCHAR_H$ac_delim +NEXT_WCHAR_H!$NEXT_WCHAR_H$ac_delim +HAVE_ISWCNTRL!$HAVE_ISWCNTRL$ac_delim +NEXT_WCTYPE_H!$NEXT_WCTYPE_H$ac_delim +HAVE_WCTYPE_H!$HAVE_WCTYPE_H$ac_delim +WCTYPE_H!$WCTYPE_H$ac_delim +REPLACE_ISWCNTRL!$REPLACE_ISWCNTRL$ac_delim +LIBGNU_LIBDEPS!$LIBGNU_LIBDEPS$ac_delim +LIBGNU_LTLIBDEPS!$LIBGNU_LTLIBDEPS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +gl_LIBOBJS!$gl_LIBOBJS$ac_delim +gl_LTLIBOBJS!$gl_LTLIBOBJS$ac_delim +gltests_LIBOBJS!$gltests_LIBOBJS$ac_delim +gltests_LTLIBOBJS!$gltests_LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-7.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' @@ -48743,7 +57520,7 @@ 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 -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" | sed -f "$tmp/subs-4.sed" | sed -f "$tmp/subs-5.sed" >$tmp/out +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" | sed -f "$tmp/subs-4.sed" | sed -f "$tmp/subs-5.sed" | sed -f "$tmp/subs-6.sed" | sed -f "$tmp/subs-7.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && @@ -49182,5 +57959,5 @@ 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" diff --git a/configure.in b/configure.in index c1548aa..68ac0a0 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_REVISION ($Revision: 2004 $) AC_PREREQ(2.59) -AC_INIT(nagios-plugins,1.4.12) +AC_INIT(nagios-plugins,1.4.13) AC_CONFIG_SRCDIR(NPTest.pm) AC_CONFIG_FILES(gl/Makefile) AC_CONFIG_AUX_DIR(build-aux) @@ -99,6 +98,9 @@ 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 release]) + dnl Checks for programs. AC_PATH_PROG(PYTHON,python) AC_PATH_PROG(SH,sh) @@ -116,7 +118,7 @@ AC_SUBST(PERL, $with_perl) dnl openssl/gnutls AC_ARG_WITH(openssl, - AC_HELP_STRING([--with-openssl=DIR], + AC_HELP_STRING([--with-openssl=DIR], [path to openssl installation]),) AC_ARG_WITH(gnutls, @@ -154,23 +156,41 @@ AC_CHECK_HEADERS(math.h) AC_CHECK_LIB(m,floor,MATHLIBS="-lm") AC_SUBST(MATHLIBS) -dnl Check for libtap, to run perl-like tests -AC_CHECK_LIB(tap, plan_tests, +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], + 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=no]) AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"]) if test "$enable_extra_opts" = "yes" ; then - EXTRA_TEST="$EXTRA_TEST test_ini test_opts" - AC_SUBST(EXTRA_TEST) 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 @@ -270,8 +290,8 @@ fi if test "$FOUNDINCLUDE" = "yes" ; then EXTRAS="$EXTRAS check_ide_smart" else - AC_MSG_WARN([Skipping check_ide_smart plugin.]) - AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.]) + AC_MSG_WARN([Skipping check_ide_smart plugin.]) + AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.]) fi dnl Check for mysql libraries @@ -456,7 +476,6 @@ AC_STRUCT_TM AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SIGNAL -AC_TYPE_MBSTATE_T AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[ AC_TRY_LINK([#include @@ -465,7 +484,7 @@ 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 +else AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[ AC_TRY_LINK([#include va_list ap1,ap2;], [__va_copy(ap1,ap2);], @@ -511,7 +530,7 @@ AC_PATH_PROG(PATH_TO_PS,ps) AC_MSG_CHECKING(for ps syntax) AC_ARG_WITH(ps_command, - ACX_HELP_STRING([--with-ps-command=PATH], + ACX_HELP_STRING([--with-ps-command=PATH], [Verbatim command to execute for ps]), PS_COMMAND=$withval) AC_ARG_WITH(ps_format, @@ -519,7 +538,7 @@ AC_ARG_WITH(ps_format, [Format string for scanning ps output]), PS_FORMAT=$withval) AC_ARG_WITH(ps_cols, - ACX_HELP_STRING([--with-ps-cols=NUM], + ACX_HELP_STRING([--with-ps-cols=NUM], [Number of columns in ps command]), PS_COLS=$withval) AC_ARG_WITH(ps_varlist, @@ -527,7 +546,7 @@ AC_ARG_WITH(ps_varlist, [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 +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" @@ -601,7 +620,7 @@ then 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 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 | \ @@ -678,9 +697,9 @@ then ac_cv_ps_cols=9 AC_MSG_RESULT([$ac_cv_ps_command]) -dnl Tru64 - needs %*[ +<>] in PS_FORMAT. +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 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 | \ egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null @@ -806,7 +825,7 @@ then ac_cv_ps_cols=8 AC_MSG_RESULT([$ac_cv_ps_command]) -dnl UnixWare +dnl UnixWare elif ps -Al 2>/dev/null | \ egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null then @@ -1171,7 +1190,7 @@ fi AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient) AC_ARG_WITH(smbclient_command, ACX_HELP_STRING([--with-smbclient-command=PATH], - [sets path to smbclient]), + [sets path to smbclient]), PATH_TO_SMBCLIENT=$withval) if test -n "$PATH_TO_SMBCLIENT" then @@ -1227,7 +1246,7 @@ 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], + ACX_HELP_STRING([--with-qstat-command=PATH], [Path to qstat command]), PATH_TO_QSTAT=$withval) if test -x "$PATH_TO_QUAKESTAT" @@ -1243,7 +1262,7 @@ 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 +if test $ac_cv_path_to_qstat then AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat", [path to qstat/quakestat]) @@ -1402,12 +1421,12 @@ AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[ #include ]) -if test "$ac_cv_have_decl_swapctl" = "yes"; +if test "$ac_cv_have_decl_swapctl" = "yes"; then EXTRAS="$EXTRAS check_swap" AC_MSG_CHECKING([for 2-arg (SVR4) swapctl]) if test "$ac_cv_type_swaptbl_t" = "yes" -a \ - "$ac_cv_type_swapent_t" = "yes"; + "$ac_cv_type_swapent_t" = "yes"; then AC_MSG_RESULT([yes]) ac_cv_check_swap_swapctl_svr4="1"; @@ -1416,7 +1435,7 @@ then else AC_MSG_RESULT([no]) AC_MSG_CHECKING([for 3-arg (*BSD) swapctl]) - if test "$ac_cv_member_struct_swapent_se_nblks" = "yes"; + if test "$ac_cv_member_struct_swapent_se_nblks" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1, @@ -1457,12 +1476,12 @@ dnl end tests for the swapctl system calls dnl -if test "x$ac_cv_have_swap" != "x" +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" fi -if test "x$ac_cv_swap_command" != "x" +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]) @@ -1507,7 +1526,7 @@ 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]), + [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]) @@ -1536,7 +1555,7 @@ case $host in *sun* | *solaris*) AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c]) ;; - *hpux*) + *hpux*) AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c]) ;; esac @@ -1556,8 +1575,8 @@ 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], +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]) @@ -1579,7 +1598,7 @@ fi dnl Perl modules AC_ARG_ENABLE(perl-modules, - AC_HELP_STRING([--enable-perl-modules], + AC_HELP_STRING([--enable-perl-modules], [Enables installation of Nagios::Plugin and its dependencies (default: no)]), [enable_perl_modules=$enableval], [enable_perl_modules=no]) @@ -1587,6 +1606,18 @@ 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 @@ -1596,24 +1627,25 @@ if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_c fi AC_OUTPUT( - Makefile - lib/Makefile - plugins/Makefile + Makefile + tap/Makefile + lib/Makefile + plugins/Makefile lib/tests/Makefile plugins-root/Makefile - plugins-scripts/Makefile - plugins-scripts/subst - plugins-scripts/utils.pm - plugins-scripts/utils.sh + plugins-scripts/Makefile + plugins-scripts/subst + plugins-scripts/utils.pm + plugins-scripts/utils.sh perlmods/Makefile - command.cfg - test.pl - pkg/solaris/pkginfo - po/Makefile.in + command.cfg + test.pl + pkg/solaris/pkginfo + po/Makefile.in ) -dnl the ones below that are commented out need to be cleaned up +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 @@ -1647,5 +1679,5 @@ ACX_FEATURE([with],[perl]) ACX_FEATURE([enable],[perl-modules]) ACX_FEATURE([with],[cgiurl]) ACX_FEATURE([with],[trusted-path]) - +ACX_FEATURE([enable],[libtap]) diff --git a/contrib/check_adptraid.sh b/contrib/check_adptraid.sh index e3c47be..8d1959b 100644 --- a/contrib/check_adptraid.sh +++ b/contrib/check_adptraid.sh @@ -13,7 +13,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision: 302 $' | sed -e 's/[^0-9.]//g'` +REVISION=`echo '$Revision: 2091 $' | sed -e 's/[^0-9.]//g'` . $PROGPATH/utils.sh diff --git a/contrib/check_apc_ups.pl b/contrib/check_apc_ups.pl index 6bf1766..d775a37 100644 --- a/contrib/check_apc_ups.pl +++ b/contrib/check_apc_ups.pl @@ -38,7 +38,7 @@ GetOptions "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 1771 $'); + print_revision($PROGNAME,'$Revision: 2091 $'); exit $ERRORS{'OK'}; } @@ -252,7 +252,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1771 $'); + print_revision($PROGNAME,'$Revision: 2091 $'); print "Copyright (c) 2001 Gerald Combs/Jeffrey Blank/Karl DeBisschop This plugin reports the status of an APC UPS equipped with an SNMP management diff --git a/contrib/check_appletalk.pl b/contrib/check_appletalk.pl index 9277686..6762c0c 100644 --- a/contrib/check_appletalk.pl +++ b/contrib/check_appletalk.pl @@ -9,7 +9,7 @@ # using "aecho" # # initial version: 23 October 2002 by Stefan Beck, IT Software Solutions -# current status: $Revision: 1771 $ +# current status: $Revision: 2091 $ # # Copyright Notice: GPL # @@ -122,7 +122,7 @@ while () { } sub print_help() { - print_revision( $PROGNAME, '$Revision: 1771 $ ' ); + print_revision( $PROGNAME, '$Revision: 2091 $ ' ); print "Copyright (c) 2002 Stefan Beck\n"; print "\n"; print "Check if an atalkhost responds to an atalk echo using\n"; @@ -159,7 +159,7 @@ sub print_usage () { } sub version () { - print_revision( $PROGNAME, '$Revision: 1771 $ ' ); + print_revision( $PROGNAME, '$Revision: 2091 $ ' ); exit $ERRORS{'OK'}; } diff --git a/contrib/check_arping.pl b/contrib/check_arping.pl index c41c4a8..44a8b46 100644 --- a/contrib/check_arping.pl +++ b/contrib/check_arping.pl @@ -55,7 +55,7 @@ if ($status == 0) if ($opt_V) { - print_revision($PROGNAME,'$Revision: 1112 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); exit $ERRORS{'OK'}; } @@ -115,6 +115,6 @@ sub print_help { print " -t (--timeout) Timeout in seconds.\n"; print " -V (--version) Plugin version\n"; print " -h (--help) usage help \n\n"; - print_revision($PROGNAME, '$Revision: 1112 $'); + print_revision($PROGNAME, '$Revision: 2091 $'); } diff --git a/contrib/check_email_loop.pl b/contrib/check_email_loop.pl index 1b02ea3..0b04487 100644 --- a/contrib/check_email_loop.pl +++ b/contrib/check_email_loop.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# $Id: check_email_loop.pl 1290 2005-11-29 23:21:06Z harpermann $ +# $Id: check_email_loop.pl 2091 2008-11-23 05:38:47Z dermoth $ # # (c)2000 Benjamin Schmid, blueshift@gmx.net (emergency use only ;-) # Copyleft by GNU GPL diff --git a/contrib/check_fan_cpq_present b/contrib/check_fan_cpq_present index 0bd1390..283e7f7 100644 --- a/contrib/check_fan_cpq_present +++ b/contrib/check_fan_cpq_present @@ -111,7 +111,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1113 $\n '); + print_revision($PROGNAME,'$Revision: 2091 $\n '); print "Copyright (c) 2003 Rainer Duffner\n "; print_usage(); print "\n"; @@ -122,7 +122,7 @@ sub print_help () { } sub version () { - print_revision($PROGNAME,'$Revision: 1113 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); exit $ERRORS{'OK'}; } diff --git a/contrib/check_fan_fsc_present b/contrib/check_fan_fsc_present index 19f8e7f..7cab0d6 100644 --- a/contrib/check_fan_fsc_present +++ b/contrib/check_fan_fsc_present @@ -113,7 +113,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1113 $\n '); + print_revision($PROGNAME,'$Revision: 2091 $\n '); print "Copyright (c) 2003 Rainer Duffner\n "; print_usage(); print "\n"; @@ -124,7 +124,7 @@ sub print_help () { } sub version () { - print_revision($PROGNAME,'$Revision: 1113 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); exit $ERRORS{'OK'}; } diff --git a/contrib/check_frontpage b/contrib/check_frontpage index 21c5267..8bef115 100644 --- a/contrib/check_frontpage +++ b/contrib/check_frontpage @@ -1,6 +1,6 @@ #! /usr/bin/perl -w # -# $Id: check_frontpage 1112 2005-01-27 04:46:08Z stanleyhopcroft $ +# $Id: check_frontpage 2091 2008-11-23 05:38:47Z dermoth $ # # Check that FrontPage extensions appear to be working on a specified host. # Currently only checks that the hit counter is not returning an error. @@ -42,7 +42,7 @@ GetOptions "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 1112 $'); #' + print_revision($PROGNAME,'$Revision: 2091 $'); #' exit $ERRORS{'OK'}; } @@ -139,7 +139,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1112 $'); + print_revision($PROGNAME,'$Revision: 2091 $'); print "Copyright (c) 2003 Kev Green\n"; print "\n"; print "FrontPage remains a copyright/trademark of Microsoft Corporation.\n"; diff --git a/contrib/check_http-with-client-certificate.c b/contrib/check_http-with-client-certificate.c index 60e1481..0f4c4eb 100644 --- a/contrib/check_http-with-client-certificate.c +++ b/contrib/check_http-with-client-certificate.c @@ -37,7 +37,7 @@ *****************************************************************************/ const char *progname = "check_http"; -#define REVISION "$Revision: 1117 $" +#define REVISION "$Revision: 2091 $" #define CVSREVISION "1.24" #define COPYRIGHT "2003" #define AUTHORS "Fabian Pehla" diff --git a/contrib/check_hw.sh b/contrib/check_hw.sh index 9d3b574..4195055 100644 --- a/contrib/check_hw.sh +++ b/contrib/check_hw.sh @@ -16,7 +16,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision: 939 $' | sed -e 's/[^0-9.]//g'` +REVISION=`echo '$Revision: 2091 $' | sed -e 's/[^0-9.]//g'` . $PROGPATH/utils.sh diff --git a/contrib/check_ica_master_browser.pl b/contrib/check_ica_master_browser.pl index 973c963..37c1b76 100755 --- a/contrib/check_ica_master_browser.pl +++ b/contrib/check_ica_master_browser.pl @@ -1,8 +1,7 @@ #!/usr/bin/perl -w -# $Id: check_ica_master_browser.pl 1099 2005-01-25 09:09:33Z stanleyhopcroft $ +# $Id: check_ica_master_browser.pl 2091 2008-11-23 05:38:47Z dermoth $ -# $Log$ # Revision 1.1 2005/01/25 09:09:33 stanleyhopcroft # New plugin - checks that ICA master browser is what it should be (important for firewalled dialup) # @@ -170,7 +169,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1099 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); print "Copyright (c) 2002 Ed Rolison/Tom De Blende/S Hopcroft Perl Check Citrix Master Browser plugin for Nagios. @@ -218,7 +217,7 @@ The ICA Client requests the address of the ICA master browser from the Citrix se } sub version () { - print_revision($PROGNAME,'$Revision: 1099 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); exit $ERRORS{'OK'}; } diff --git a/contrib/check_ica_metaframe_pub_apps.pl b/contrib/check_ica_metaframe_pub_apps.pl index 17c5309..c71a9c3 100755 --- a/contrib/check_ica_metaframe_pub_apps.pl +++ b/contrib/check_ica_metaframe_pub_apps.pl @@ -1,8 +1,7 @@ #!/usr/bin/perl -w -# $Id: check_ica_metaframe_pub_apps.pl 1098 2005-01-25 09:07:39Z stanleyhopcroft $ +# $Id: check_ica_metaframe_pub_apps.pl 2091 2008-11-23 05:38:47Z dermoth $ -# $Log$ # Revision 1.1 2005/01/25 09:07:39 stanleyhopcroft # Replacement (structured name mainly) for check_citrix: check of ICA browse service # @@ -303,7 +302,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1098 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); print "Copyright (c) 2002 Ed Rolison/Tom De Blende/S Hopcroft Perl Check Citrix plugin for Nagios. @@ -350,7 +349,7 @@ The plugin works by } sub version () { - print_revision($PROGNAME,'$Revision: 1098 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); exit $ERRORS{'OK'}; } diff --git a/contrib/check_ica_program_neigbourhood.pl b/contrib/check_ica_program_neigbourhood.pl index ceb4c95..5b79459 100755 --- a/contrib/check_ica_program_neigbourhood.pl +++ b/contrib/check_ica_program_neigbourhood.pl @@ -1,8 +1,7 @@ #!/usr/bin/perl -w -# $Id: check_ica_program_neigbourhood.pl 1097 2005-01-25 09:05:53Z stanleyhopcroft $ +# $Id: check_ica_program_neigbourhood.pl 2091 2008-11-23 05:38:47Z dermoth $ -# $Log$ # Revision 1.1 2005/01/25 09:05:53 stanleyhopcroft # New plugin to check Citrix Metaframe XP "Program Neighbourhood" # @@ -290,7 +289,7 @@ sub print_help() { # 1 2 3 4 5 6 7 8 #12345678901234567890123456789012345678901234567890123456789012345678901234567890 - print_revision($PROGNAME,'$Revision: 1097 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); my $help = < # diff --git a/contrib/check_ms_spooler.pl b/contrib/check_ms_spooler.pl index 8c6e64e..e1b907d 100755 --- a/contrib/check_ms_spooler.pl +++ b/contrib/check_ms_spooler.pl @@ -1,8 +1,7 @@ #!/usr/bin/perl -w -# $Id: check_ms_spooler.pl 64 2002-07-16 00:04:42Z stanleyhopcroft $ +# $Id: check_ms_spooler.pl 2091 2008-11-23 05:38:47Z dermoth $ -# $Log$ # Revision 1.1 2002/07/16 00:04:42 stanleyhopcroft # Primitive and in need of refinement test of MS spooler (with smbclient) # @@ -268,7 +267,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 64 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); print "Copyright (c) 2001 Karl DeBisschop/S Hopcroft Perl Check MS Spooler plugin for NetSaint. Display a subset of the queues on an SMB (Samba or MS) print spooler. @@ -292,7 +291,7 @@ Perl Check MS Spooler plugin for NetSaint. Display a subset of the queues on an } sub version () { - print_revision($PROGNAME,'$Revision: 64 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); exit $ERRORS{'OK'}; } diff --git a/contrib/check_ora_table_space.pl b/contrib/check_ora_table_space.pl index 9777250..cd66e03 100644 --- a/contrib/check_ora_table_space.pl +++ b/contrib/check_ora_table_space.pl @@ -4,8 +4,8 @@ # Written by: Erwan Arzur (erwan@netvalue.com) # License: GPL # -# Last Modified: $Date: 2002-02-28 06:42:51 +0000 (Thu, 28 Feb 2002) $ -# Revisiin: $Revision: 2 $ +# Last Modified: $Date: 2008-11-23 05:38:47 +0000 (Sun, 23 Nov 2008) $ +# Revisiin: $Revision: 2091 $ # # "check_ora_table_space.pl" plugin to check the state of Oracle # table spaces. Scarce documentation. diff --git a/contrib/check_oracle_instance.pl b/contrib/check_oracle_instance.pl index 3ba8d57..ee053c0 100644 --- a/contrib/check_oracle_instance.pl +++ b/contrib/check_oracle_instance.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: check_oracle_instance.pl 10 2002-04-03 02:58:47Z sghosh $ +# $Id: check_oracle_instance.pl 2091 2008-11-23 05:38:47Z dermoth $ # Copyright (c) 2002 Sven Dolderer # some pieces of Code adopted from Adam vonNieda's oracletool.pl @@ -23,7 +23,7 @@ require DBD::Oracle || die "It appears that the DBD::Oracle module is not instal use vars qw($VERSION $PROGNAME $logfile $debug $state $dbh $database $username $password $message $sql $cursor $opt_asession $opt_nsession $opt_tablespace $opt_nextents $opt_fextents $opt_aextents $privsok $warn $critical); -'$Revision: 10 $' =~ /^.*(\d+.\d+) \$$/; # Use The Revision from RCS/CVS +'$Revision: 2091 $' =~ /^.*(\d+.\d+) \$$/; # Use The Revision from RCS/CVS $VERSION = $1; $0 =~ m!^.*/([^/]+)$!; $PROGNAME = $1; diff --git a/contrib/check_oracle_tbs b/contrib/check_oracle_tbs index 8281a4e..43c9273 100644 --- a/contrib/check_oracle_tbs +++ b/contrib/check_oracle_tbs @@ -30,7 +30,7 @@ if (!$ENV{ORACLE_HOME}) { my $state = $ERRORS{'UNKNOWN'}; my $answer = undef; -my ($MAJOR_VERSION, $MINOR_VERSION) = q$Revision: 1134 $ =~ /(\d+)\.(\d+)/; +my ($MAJOR_VERSION, $MINOR_VERSION) = q$Revision: 2091 $ =~ /(\d+)\.(\d+)/; my $VERSION = sprintf("%d.%02d", $MAJOR_VERSION - 1, $MINOR_VERSION); my $opt_debug; # -d|--debug diff --git a/contrib/check_pfstate b/contrib/check_pfstate index 57dde3f..25f2034 100644 --- a/contrib/check_pfstate +++ b/contrib/check_pfstate @@ -27,7 +27,7 @@ GetOptions "c=s" => \$opt_c, "critical=s" => \$opt_c); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 1112 $'); + print_revision($PROGNAME,'$Revision: 2091 $'); exit $ERRORS{'OK'}; } if ($opt_h) { @@ -67,7 +67,7 @@ exit $ERRORS{'OK'}; sub print_help { - print_revision($PROGNAME,'$Revision: 1112 $'); + print_revision($PROGNAME,'$Revision: 2091 $'); print "Copyright (c) 2002 Jason Dixon\n\nThis plugin checks the number of state table entries on a PF-enabled OpenBSD system.\n\n"; print "Usage:\t-H, --hostname= [-w, --warning=] [-c, --critical=]\n\n\tDefault warning is 50000 and critical is 60000.\n\n"; support(); diff --git a/contrib/check_rbl.c b/contrib/check_rbl.c index eec84ad..7447b9e 100644 --- a/contrib/check_rbl.c +++ b/contrib/check_rbl.c @@ -11,7 +11,7 @@ * * License: GPL * * Copyright (c) 2000 * * -* * $Id: check_rbl.c 970 2004-12-02 00:30:32Z opensides $ +* * $Id: check_rbl.c 2091 2008-11-23 05:38:47Z dermoth $ * *****************************************************************************/ @@ -22,7 +22,7 @@ #include "string.h" const char progname = "check_rbl"; -const char *revision = "$Revision: 970 $"; +const char *revision = "$Revision: 2091 $"; //const char *copyright = "2000-2003"; //const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -263,7 +263,7 @@ int call_getopt(int argc, char **argv) } break; case 'V': /* version */ - print_revision(progname,"$Revision: 970 $"); + print_revision(progname,"$Revision: 2091 $"); exit(STATE_OK); case 'h': /* help */ print_help(); @@ -291,7 +291,7 @@ int validate_arguments(void) void print_help(void) { - print_revision(progname,"$Revision: 970 $"); + print_revision(progname,"$Revision: 2091 $"); printf ("Copyright (c) 2000 Karl DeBisschop\n\n" "This plugin uses dig to test whether the specified host is on any RBL lists.\n\n"); diff --git a/contrib/check_smb.sh b/contrib/check_smb.sh index 9d0da72..f05d8d9 100644 --- a/contrib/check_smb.sh +++ b/contrib/check_smb.sh @@ -26,7 +26,7 @@ # PROGNAME=`basename $0` PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision: 71 $' | sed -e 's/[^0-9.]//g'` +REVISION=`echo '$Revision: 2091 $' | sed -e 's/[^0-9.]//g'` . $PROGPATH/utils.sh diff --git a/contrib/check_snmp_disk_monitor.pl b/contrib/check_snmp_disk_monitor.pl index 9a2edaa..190aaa4 100644 --- a/contrib/check_snmp_disk_monitor.pl +++ b/contrib/check_snmp_disk_monitor.pl @@ -52,7 +52,7 @@ sub process_options { } sub local_print_revision { - print_revision( $PROGNAME, '$Revision: 82 $ ' ) + print_revision( $PROGNAME, '$Revision: 2091 $ ' ) } sub print_usage { diff --git a/contrib/check_snmp_printer.pl b/contrib/check_snmp_printer.pl index cc7943b..0efb4f7 100755 --- a/contrib/check_snmp_printer.pl +++ b/contrib/check_snmp_printer.pl @@ -116,7 +116,7 @@ GetOptions $PROGNAME = "check_snmp_printer"; if ($opt_V) { - print_revision($PROGNAME,'$Revision: 795 $'); + print_revision($PROGNAME,'$Revision: 2091 $'); exit $ERRORS{'OK'}; } @@ -572,7 +572,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 795 $'); + print_revision($PROGNAME,'$Revision: 2091 $'); print "Copyright (c) 2002 Subhendu Ghosh/Ethan Galstad. This plugin reports the status of an network printer with an SNMP management diff --git a/contrib/check_snmp_process_monitor.pl b/contrib/check_snmp_process_monitor.pl index 0f44597..7a89eb7 100644 --- a/contrib/check_snmp_process_monitor.pl +++ b/contrib/check_snmp_process_monitor.pl @@ -91,7 +91,7 @@ sub process_options { } sub local_print_revision { - print_revision( $PROGNAME, '$Revision: 84 $ ' ) + print_revision( $PROGNAME, '$Revision: 2091 $ ' ) } sub print_usage { diff --git a/contrib/check_snmp_procs.pl b/contrib/check_snmp_procs.pl index 4d19ff1..d4a08d6 100644 --- a/contrib/check_snmp_procs.pl +++ b/contrib/check_snmp_procs.pl @@ -109,7 +109,7 @@ if (GetOptions( } if ($opt_version) { - print_revision($PROGNAME, "\$Revision: 1771 $REVISION \$"); + print_revision($PROGNAME, "\$Revision: 2091 $REVISION \$"); exit $ERRORS{'OK'}; } @@ -529,7 +529,7 @@ sub print_usage { # sub print_help { - print_revision($PROGNAME, "\$Revision: 1771 $REVISION \$"); + print_revision($PROGNAME, "\$Revision: 2091 $REVISION \$"); print "Copyright (c) 2003 David Alden Check if processes are running on a host via snmp diff --git a/contrib/check_temp_cpq b/contrib/check_temp_cpq index 6edae6e..766f8f7 100644 --- a/contrib/check_temp_cpq +++ b/contrib/check_temp_cpq @@ -138,7 +138,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1113 $\n '); + print_revision($PROGNAME,'$Revision: 2091 $\n '); print "Copyright (c) 2003 Rainer Duffner\n "; print_usage(); print "\n"; @@ -151,7 +151,7 @@ sub print_help () { } sub version () { - print_revision($PROGNAME,'$Revision: 1113 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); exit $ERRORS{'OK'}; } diff --git a/contrib/check_temp_fsc b/contrib/check_temp_fsc index 33470ea..eba368a 100644 --- a/contrib/check_temp_fsc +++ b/contrib/check_temp_fsc @@ -138,7 +138,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1113 $\n '); + print_revision($PROGNAME,'$Revision: 2091 $\n '); print "Copyright (c) 2003 Rainer Duffner\n "; print_usage(); print "\n"; @@ -149,7 +149,7 @@ sub print_help () { } sub version () { - print_revision($PROGNAME,'$Revision: 1113 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); exit $ERRORS{'OK'}; } diff --git a/contrib/check_traceroute.pl b/contrib/check_traceroute.pl index ae8d36c..c1e621d 100755 --- a/contrib/check_traceroute.pl +++ b/contrib/check_traceroute.pl @@ -1,8 +1,7 @@ #!/usr/bin/perl -# $Id: check_traceroute.pl 1115 2005-01-27 10:34:16Z stanleyhopcroft $ +# $Id: check_traceroute.pl 2091 2008-11-23 05:38:47Z dermoth $ -# $Log$ # Revision 1.1 2005/01/27 10:34:16 stanleyhopcroft # Jon Meek's check_traceroute for Mon hacked by YT for Nagios. Prob pretty weak # @@ -32,7 +31,7 @@ getopts('i:H:N:R:T:dhrvV'); do { print_help ; exit $ERRORS{OK}; } if $opt_h ; -do { print_revision($PROGNAME, '$Revision: 1115 $'); exit $ERRORS{OK}; } +do { print_revision($PROGNAME, '$Revision: 2091 $'); exit $ERRORS{OK}; } if $opt_V ; do { print_help; exit $ERRORS{OK}; } @@ -176,7 +175,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME, '$Revision: 1115 $') ; + print_revision($PROGNAME, '$Revision: 2091 $') ; print "Copyright (c) 2004 J Meek/Karl DeBisschop This plugin checks whether traceroute to the destination succeeds and if so that the route string option (-R) matches the list of routers diff --git a/contrib/check_uptime.c b/contrib/check_uptime.c index 2bef2bb..478493e 100644 --- a/contrib/check_uptime.c +++ b/contrib/check_uptime.c @@ -9,7 +9,7 @@ * Based on CHECK_LOAD.C * Copyright (c) 1999 Felipe Gustavo de Almeida * - * Last Modified: $Date: 2002-03-01 02:42:56 +0000 (Fri, 01 Mar 2002) $ + * Last Modified: $Date: 2008-11-23 05:38:47 +0000 (Sun, 23 Nov 2008) $ * * Command line: CHECK_UPTIME * @@ -44,7 +44,7 @@ int main(int argc, char **argv) if(argc != 2){ printf("Incorrect number of arguments supplied\n"); printf("\n"); - print_revision(argv[0],"$Revision: 6 $"); + print_revision(argv[0],"$Revision: 2091 $"); printf("Copyright (c) 2000 Teresa Ramanan (tlr@redowl.org)\n"); printf("\n"); printf("Usage: %s \n",argv[0]); diff --git a/contrib/check_vcs.pl b/contrib/check_vcs.pl index 38afdae..ae2f1fd 100644 --- a/contrib/check_vcs.pl +++ b/contrib/check_vcs.pl @@ -71,7 +71,7 @@ sub print_help (); $vcs_negate = ''; $vcs_result = ''; $vcs_expected_result = 'ONLINE'; - $plugin_revision = '$Revision: 33 $ '; + $plugin_revision = '$Revision: 2091 $ '; # Grab options from command line GetOptions diff --git a/contrib/check_wins.pl b/contrib/check_wins.pl index a1b762a..1bb7a19 100755 --- a/contrib/check_wins.pl +++ b/contrib/check_wins.pl @@ -1,8 +1,7 @@ #!/usr/bin/perl -w -# $Id: check_wins.pl 940 2004-11-25 04:46:16Z stanleyhopcroft $ +# $Id: check_wins.pl 2091 2008-11-23 05:38:47Z dermoth $ -# $Log$ # Revision 1.3 2004/11/25 04:46:16 stanleyhopcroft # Non functional tidy ups to check_wins # @@ -190,7 +189,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 940 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); print "Copyright (c) 2001 Karl DeBisschop/S Hopcroft Perl Check WINS plugin for NetSaint. @@ -237,7 +236,7 @@ The plugin works by } sub version () { - print_revision($PROGNAME,'$Revision: 940 $ '); + print_revision($PROGNAME,'$Revision: 2091 $ '); exit $ERRORS{'OK'}; } diff --git a/contrib/packet_utils.pm b/contrib/packet_utils.pm index 4c12656..1868f2f 100755 --- a/contrib/packet_utils.pm +++ b/contrib/packet_utils.pm @@ -1,8 +1,7 @@ package packet_utils; -# $Id: packet_utils.pm 1100 2005-01-25 09:12:47Z stanleyhopcroft $ +# $Id: packet_utils.pm 2091 2008-11-23 05:38:47Z dermoth $ -# $Log$ # Revision 1.1 2005/01/25 09:12:47 stanleyhopcroft # packet creation and dumping hacks used by check_ica* and check_lotus # diff --git a/contrib/utils.py b/contrib/utils.py index db0f1c9..be44036 100644 --- a/contrib/utils.py +++ b/contrib/utils.py @@ -8,7 +8,7 @@ #========================================================================== # -# Version: = '$Id: utils.py 2 2002-02-28 06:42:51Z egalstad $' +# Version: = '$Id: utils.py 2091 2008-11-23 05:38:47Z dermoth $' # # (C) Rob W.W. Hooft, Nonius BV, 1998 # diff --git a/gl/Makefile.am b/gl/Makefile.am index 1eefee9..87fe031 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2004-2007 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -9,10 +9,11 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --aux-dir=build-aux --no-libtool --macro-prefix=gl base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex vasprintf vsnprintf +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex timegm vasprintf vsnprintf AUTOMAKE_OPTIONS = 1.5 gnits +SUBDIRS = noinst_HEADERS = noinst_LIBRARIES = noinst_LTLIBRARIES = @@ -24,8 +25,10 @@ MOSTLYCLEANDIRS = CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = +EXTRA_DIST += m4/gnulib-cache.m4 AM_CPPFLAGS = +AM_CFLAGS = noinst_LIBRARIES += libgnu.a @@ -34,14 +37,12 @@ libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) EXTRA_libgnu_a_SOURCES = -## begin gnulib module absolute-header +## begin gnulib module alignof -# 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__ || 60000000 <= __DECC_VER) -## end gnulib module absolute-header +EXTRA_DIST += alignof.h + +## end gnulib module alignof ## begin gnulib module alloca @@ -77,16 +78,27 @@ BUILT_SOURCES += $(ARPA_INET_H) # We need the following in order to create when the system # doesn't have one. -arpa/inet.h: +arpa/inet.h: arpa_inet.in.h @MKDIR_P@ arpa rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - echo '#include '; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|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''@|$(GNULIB_INET_NTOP)|g' \ + -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \ + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/arpa_inet.in.h; \ } > $@-t 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 base64 @@ -95,6 +107,15 @@ libgnu_a_SOURCES += base64.h base64.c ## end gnulib module base64 +## begin gnulib module btowc + + +EXTRA_DIST += btowc.c + +EXTRA_libgnu_a_SOURCES += btowc.c + +## end gnulib module btowc + ## begin gnulib module c-strtod @@ -133,7 +154,7 @@ EXTRA_libgnu_a_SOURCES += cloexec.c # The Automake-defined pkg* macros are appended, in the order # listed in the Automake 1.10a+ documentation. configmake.h: Makefile - rm -f $@-t $@ + rm -f $@-t { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#define PREFIX "$(prefix)"'; \ echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ @@ -163,7 +184,12 @@ configmake.h: Makefile echo '#define PKGLIBDIR "$(pkglibdir)"'; \ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ } | sed '/""/d' > $@-t - mv $@-t $@ + if test -f $@ && cmp $@-t $@ > /dev/null; then \ + rm -f $@-t; \ + else \ + rm -f $@; mv $@-t $@; \ + fi + BUILT_SOURCES += configmake.h CLEANFILES += configmake.h configmake.h-t @@ -178,6 +204,33 @@ EXTRA_libgnu_a_SOURCES += basename.c dirname.c stripslash.c ## end gnulib module dirname +## begin gnulib module errno + +BUILT_SOURCES += $(ERRNO_H) + +# We need the following in order to create when the system +# doesn't have one that is POSIX compliant. +errno.h: errno.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|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 + mv $@-t $@ +MOSTLYCLEANFILES += errno.h errno.h-t + +EXTRA_DIST += errno.in.h + +## end gnulib module errno + ## begin gnulib module error @@ -196,6 +249,29 @@ EXTRA_libgnu_a_SOURCES += exitfail.c ## end gnulib module exitfail +## begin gnulib module fcntl + +BUILT_SOURCES += $(FCNTL_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +fcntl.h: fcntl.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + < $(srcdir)/fcntl.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += fcntl.h fcntl.h-t + +EXTRA_DIST += fcntl.in.h + +## end gnulib module fcntl + ## begin gnulib module fcntl-safer @@ -214,7 +290,8 @@ BUILT_SOURCES += $(FLOAT_H) float.h: float.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ < $(srcdir)/float.in.h; \ } > $@-t @@ -258,7 +335,7 @@ libgnu_a_SOURCES += full-write.h full-write.c ## begin gnulib module getaddrinfo -EXTRA_DIST += gai_strerror.c getaddrinfo.c getaddrinfo.h +EXTRA_DIST += gai_strerror.c getaddrinfo.c EXTRA_libgnu_a_SOURCES += gai_strerror.c getaddrinfo.c @@ -333,7 +410,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath ## begin gnulib module inet_ntop -EXTRA_DIST += inet_ntop.c inet_ntop.h +EXTRA_DIST += inet_ntop.c EXTRA_libgnu_a_SOURCES += inet_ntop.c @@ -369,21 +446,37 @@ all-local: charset.alias ref-add.sed ref-del.sed charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_tmp = $(DESTDIR)$(libdir)/charset.tmp -install-exec-local: all-local - test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) +install-exec-local: install-exec-localcharset +install-exec-localcharset: all-local + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ if test -f $(charset_alias); then \ sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ else \ - if test $(GLIBC21) = no; then \ + if $$need_charset_alias; then \ sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ fi ; \ fi -uninstall-local: all-local +uninstall-local: uninstall-localcharset +uninstall-localcharset: all-local if test -f $(charset_alias); then \ sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ if grep '^# Packages using this file: $$' $(charset_tmp) \ @@ -439,7 +532,8 @@ BUILT_SOURCES += math.h math.h: math.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_MATH_H''@|$(NEXT_MATH_H)|g' \ -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \ -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \ @@ -448,6 +542,11 @@ math.h: math.in.h -e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \ -e 's|@''GNULIB_FREXPL''@|$(GNULIB_FREXPL)|g' \ -e 's|@''GNULIB_ISFINITE''@|$(GNULIB_ISFINITE)|g' \ + -e 's|@''GNULIB_ISINF''@|$(GNULIB_ISINF)|g' \ + -e 's|@''GNULIB_ISNAN''@|$(GNULIB_ISNAN)|g' \ + -e 's|@''GNULIB_ISNANF''@|$(GNULIB_ISNANF)|g' \ + -e 's|@''GNULIB_ISNAND''@|$(GNULIB_ISNAND)|g' \ + -e 's|@''GNULIB_ISNANL''@|$(GNULIB_ISNANL)|g' \ -e 's|@''GNULIB_LDEXPL''@|$(GNULIB_LDEXPL)|g' \ -e 's|@''GNULIB_MATHL''@|$(GNULIB_MATHL)|g' \ -e 's|@''GNULIB_ROUND''@|$(GNULIB_ROUND)|g' \ @@ -457,6 +556,9 @@ math.h: math.in.h -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \ -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \ -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|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_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ @@ -470,20 +572,24 @@ math.h: math.in.h -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' \ -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \ -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|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_ISFINITE''@|$(REPLACE_ISFINITE)|g' \ + -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \ + -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \ -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \ + -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|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_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/math.in.h; \ } > $@-t @@ -494,6 +600,33 @@ EXTRA_DIST += math.in.h ## end gnulib module math +## begin gnulib module mbrtowc + + +EXTRA_DIST += mbrtowc.c + +EXTRA_libgnu_a_SOURCES += mbrtowc.c + +## end gnulib module mbrtowc + +## begin gnulib module mbsinit + + +EXTRA_DIST += mbsinit.c + +EXTRA_libgnu_a_SOURCES += mbsinit.c + +## end gnulib module mbsinit + +## begin gnulib module mktime + + +EXTRA_DIST += mktime.c + +EXTRA_libgnu_a_SOURCES += mktime.c + +## end gnulib module mktime + ## begin gnulib module mountlist @@ -503,6 +636,34 @@ EXTRA_libgnu_a_SOURCES += mountlist.c ## end gnulib module mountlist +## begin gnulib module netdb + +BUILT_SOURCES += $(NETDB_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +netdb.h: netdb.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \ + -e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \ + -e 's|@''GNULIB_GETADDRINFO''@|$(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' \ + < $(srcdir)/netdb.in.h; \ + } > $@-t + 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) @@ -513,7 +674,8 @@ netinet/in.h: netinet_in.in.h @MKDIR_P@ netinet rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|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; \ @@ -526,6 +688,15 @@ EXTRA_DIST += netinet_in.in.h ## end gnulib module netinet_in +## begin gnulib module open + + +EXTRA_DIST += open.c + +EXTRA_libgnu_a_SOURCES += open.c + +## end gnulib module open + ## begin gnulib module regex @@ -596,7 +767,8 @@ stdint.h: stdint.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ - -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ @@ -604,6 +776,7 @@ stdint.h: stdint.in.h -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/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' \ @@ -635,17 +808,26 @@ BUILT_SOURCES += stdio.h stdio.h: stdio.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ + -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \ -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \ -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \ -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \ -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \ -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \ -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ + -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ + -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ + -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \ -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \ -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \ @@ -653,8 +835,18 @@ stdio.h: stdio.in.h -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \ -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \ -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \ + -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \ + -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \ + -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \ + -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \ + -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \ + -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \ + -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \ -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \ -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \ + -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \ + -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \ + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ @@ -665,8 +857,14 @@ stdio.h: stdio.in.h -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \ -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ @@ -674,16 +872,20 @@ stdio.h: stdio.in.h -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/stdio.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdio.h stdio.h-t -EXTRA_DIST += stdio.in.h +EXTRA_DIST += stdio-write.c stdio.in.h + +EXTRA_libgnu_a_SOURCES += stdio-write.c ## end gnulib module stdio @@ -696,26 +898,45 @@ BUILT_SOURCES += stdlib.h stdlib.h: stdlib.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ + -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ + -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ + -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ + -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ + -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ + -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ + -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|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_UNSETENV''@|$(HAVE_UNSETENV)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/stdlib.in.h; \ @@ -727,14 +948,21 @@ EXTRA_DIST += stdlib.in.h ## end gnulib module stdlib -## begin gnulib module strdup +## begin gnulib module strdup-posix EXTRA_DIST += strdup.c EXTRA_libgnu_a_SOURCES += strdup.c -## end gnulib module strdup +## end gnulib module strdup-posix + +## begin gnulib module streq + + +EXTRA_DIST += streq.h + +## end gnulib module streq ## begin gnulib module strerror @@ -754,7 +982,8 @@ BUILT_SOURCES += string.h string.h: string.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \ -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \ @@ -773,6 +1002,7 @@ string.h: string.in.h -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \ -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \ -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \ + -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \ -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \ -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \ -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \ @@ -786,9 +1016,11 @@ string.h: string.in.h -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \ -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \ -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \ + -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|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_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' \ @@ -802,8 +1034,10 @@ string.h: string.in.h -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ @@ -844,11 +1078,29 @@ BUILT_SOURCES += $(SYS_SOCKET_H) sys/socket.h: sys_socket.in.h @MKDIR_P@ sys { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|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''@|$(GNULIB_CLOSE)|g' \ + -e 's|@''GNULIB_SOCKET''@|$(GNULIB_SOCKET)|g' \ + -e 's|@''GNULIB_CONNECT''@|$(GNULIB_CONNECT)|g' \ + -e 's|@''GNULIB_ACCEPT''@|$(GNULIB_ACCEPT)|g' \ + -e 's|@''GNULIB_BIND''@|$(GNULIB_BIND)|g' \ + -e 's|@''GNULIB_GETPEERNAME''@|$(GNULIB_GETPEERNAME)|g' \ + -e 's|@''GNULIB_GETSOCKNAME''@|$(GNULIB_GETSOCKNAME)|g' \ + -e 's|@''GNULIB_GETSOCKOPT''@|$(GNULIB_GETSOCKOPT)|g' \ + -e 's|@''GNULIB_LISTEN''@|$(GNULIB_LISTEN)|g' \ + -e 's|@''GNULIB_RECV''@|$(GNULIB_RECV)|g' \ + -e 's|@''GNULIB_SEND''@|$(GNULIB_SEND)|g' \ + -e 's|@''GNULIB_RECVFROM''@|$(GNULIB_RECVFROM)|g' \ + -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \ + -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \ + -e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/sys_socket.in.h; \ } > $@-t mv -f $@-t $@ @@ -859,6 +1111,51 @@ EXTRA_DIST += sys_socket.in.h ## end gnulib module sys_socket +## begin gnulib module time + +BUILT_SOURCES += time.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +time.h: time.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ + -e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ + -e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \ + -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|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' \ + < $(srcdir)/time.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += time.h time.h-t + +EXTRA_DIST += time.in.h + +## end gnulib module time + +## begin gnulib module time_r + + +EXTRA_DIST += time_r.c + +EXTRA_libgnu_a_SOURCES += time_r.c + +## end gnulib module time_r + +## begin gnulib module timegm + + +EXTRA_DIST += timegm.c + +EXTRA_libgnu_a_SOURCES += timegm.c + +## end gnulib module timegm + ## begin gnulib module unistd BUILT_SOURCES += unistd.h @@ -869,33 +1166,57 @@ unistd.h: unistd.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ - -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ + -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ + -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ + -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ + -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ + -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ + -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ + -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ + -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ + -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/unistd.in.h; \ } > $@-t mv $@-t $@ @@ -932,6 +1253,12 @@ EXTRA_libgnu_a_SOURCES += asprintf.c vasprintf.c ## end gnulib module vasprintf +## begin gnulib module verify + +libgnu_a_SOURCES += verify.h + +## end gnulib module verify + ## begin gnulib module vsnprintf @@ -950,11 +1277,44 @@ BUILT_SOURCES += $(WCHAR_H) wchar.h: wchar.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ - -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \ + -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \ + -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \ + -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \ + -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \ + -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \ + -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \ + -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \ + -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \ + -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \ -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ + -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_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + -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_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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/wchar.in.h; \ @@ -966,6 +1326,15 @@ EXTRA_DIST += wchar.in.h ## end gnulib module wchar +## begin gnulib module wcrtomb + + +EXTRA_DIST += wcrtomb.c + +EXTRA_libgnu_a_SOURCES += wcrtomb.c + +## end gnulib module wcrtomb + ## begin gnulib module wctype BUILT_SOURCES += $(WCTYPE_H) @@ -976,10 +1345,12 @@ wctype.h: wctype.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ - -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ < $(srcdir)/wctype.in.h; \ } > $@-t mv $@-t $@ @@ -989,6 +1360,15 @@ EXTRA_DIST += wctype.in.h ## end gnulib module wctype +## begin gnulib module write + + +EXTRA_DIST += write.c + +EXTRA_libgnu_a_SOURCES += write.c + +## end gnulib module write + ## begin gnulib module xalloc diff --git a/gl/Makefile.in b/gl/Makefile.in index baa0a2a..2771e5c 100644 --- a/gl/Makefile.in +++ b/gl/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2004-2007 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -23,7 +23,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --aux-dir=build-aux --no-libtool --macro-prefix=gl base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex vasprintf vsnprintf +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex timegm vasprintf vsnprintf @@ -53,17 +53,19 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in alloca.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ - $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ - $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \ - $(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \ - $(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \ + $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \ + $(top_srcdir)/gl/m4/dos.m4 \ $(top_srcdir)/gl/m4/double-slash-root.m4 \ - $(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \ + $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \ $(top_srcdir)/gl/m4/exitfail.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-safer.m4 \ - $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \ + $(top_srcdir)/gl/m4/floorf.m4 \ $(top_srcdir)/gl/m4/fstypename.m4 \ $(top_srcdir)/gl/m4/fsusage.m4 \ $(top_srcdir)/gl/m4/getaddrinfo.m4 \ @@ -73,7 +75,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/glibc21.m4 \ $(top_srcdir)/gl/m4/gnulib-common.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ - $(top_srcdir)/gl/m4/iconv.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/iconv.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \ $(top_srcdir)/gl/m4/intlmacosx.m4 \ @@ -82,17 +84,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \ $(top_srcdir)/gl/m4/lib-prefix.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/longlong.m4 \ $(top_srcdir)/gl/m4/ls-mntd-fs.m4 \ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \ $(top_srcdir)/gl/m4/mountlist.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/nls.m4 \ - $(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \ + $(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \ $(top_srcdir)/gl/m4/safe-read.m4 \ $(top_srcdir)/gl/m4/safe-write.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \ $(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \ @@ -102,13 +111,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \ $(top_srcdir)/gl/m4/strnlen.m4 \ $(top_srcdir)/gl/m4/sys_socket_h.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/unistd-safer.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/vasnprintf.m4 \ $(top_srcdir)/gl/m4/vasprintf.m4 \ $(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \ - $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \ - $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \ + $(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ + $(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -138,9 +150,16 @@ LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) DIST_SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INSTALL = @INSTALL@ ACLOCAL = @ACLOCAL@ @@ -149,6 +168,7 @@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ @@ -179,16 +199,24 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +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@ F77 = @F77@ +FCNTL_H = @FCNTL_H@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ @@ -197,47 +225,85 @@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPL = @GNULIB_FREXPL@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -247,18 +313,37 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_ROUND = @GNULIB_ROUND@ GNULIB_ROUNDF = @GNULIB_ROUNDF@ GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ @@ -271,32 +356,57 @@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ 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_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ @@ -309,25 +419,46 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_OS_H = @HAVE_OS_H@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ @@ -341,8 +472,16 @@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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@ @@ -350,14 +489,20 @@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +HOSTENT_LIB = @HOSTENT_LIB@ HOSTNAME = @HOSTNAME@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -379,6 +524,10 @@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -391,15 +540,21 @@ MYSQLCFLAGS = @MYSQLCFLAGS@ MYSQLINCLUDE = @MYSQLINCLUDE@ MYSQLLIBS = @MYSQLLIBS@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_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@ @@ -441,16 +596,23 @@ PKG_ARCH = @PKG_ARCH@ PLUGIN_TEST = @PLUGIN_TEST@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PST3CFLAGS = @PST3CFLAGS@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ PYTHON = @PYTHON@ RADIUSLIBS = @RADIUSLIBS@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ +RELEASE_PRESENT_FALSE = @RELEASE_PRESENT_FALSE@ +RELEASE_PRESENT_TRUE = @RELEASE_PRESENT_TRUE@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -466,12 +628,28 @@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ +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_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -481,19 +659,32 @@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ 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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ REV_DATESTAMP = @REV_DATESTAMP@ REV_TIMESTAMP = @REV_TIMESTAMP@ SCRIPT_TEST = @SCRIPT_TEST@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ @@ -507,6 +698,11 @@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_LIBTAP_LOCAL_FALSE = @USE_LIBTAP_LOCAL_FALSE@ +USE_LIBTAP_LOCAL_TRUE = @USE_LIBTAP_LOCAL_TRUE@ USE_NLS = @USE_NLS@ USE_PARSE_INI_FALSE = @USE_PARSE_INI_FALSE@ USE_PARSE_INI_TRUE = @USE_PARSE_INI_TRUE@ @@ -575,40 +771,47 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ with_trusted_path = @with_trusted_path@ AUTOMAKE_OPTIONS = 1.5 gnits +SUBDIRS = noinst_HEADERS = noinst_LIBRARIES = libgnu.a noinst_LTLIBRARIES = -EXTRA_DIST = alloca.c alloca.in.h c-strtod.c c-strtod.h cloexec.c \ - cloexec.h basename.c dirname.c dirname.h stripslash.c error.c \ - error.h exitfail.c exitfail.h creat-safer.c fcntl--.h \ - fcntl-safer.h open-safer.c float.in.h floor.c floorf.c \ - fsusage.c fsusage.h gai_strerror.c getaddrinfo.c getaddrinfo.h \ - gethostname.c getloadavg.c getopt.c getopt.in.h getopt1.c \ - getopt_int.h $(top_srcdir)/build-aux/config.rpath \ - $(top_srcdir)/build-aux/config.rpath inet_ntop.c inet_ntop.h \ - intprops.h $(top_srcdir)/build-aux/link-warning.h \ - config.charset ref-add.sin ref-del.sin malloc.c malloc.c \ - math.in.h mountlist.c mountlist.h netinet_in.in.h regcomp.c \ - regex.c regex.h regex_internal.c regex_internal.h regexec.c \ - safe-read.c safe-read.h safe-write.c safe-write.h snprintf.c \ - stdbool.in.h stdint.in.h stdio.in.h stdlib.in.h strdup.c \ - strerror.c string.in.h strndup.c strnlen.c sys_socket.in.h \ - unistd.in.h dup-safer.c fd-safer.c pipe-safer.c unistd--.h \ - unistd-safer.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 vsnprintf.c wchar.in.h \ - wctype.in.h xalloc.h xmalloc.c -BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) configmake.h $(FLOAT_H) \ - $(GETOPT_H) math.h $(NETINET_IN_H) $(STDBOOL_H) $(STDINT_H) \ - stdio.h stdlib.h string.h $(SYS_SOCKET_H) unistd.h $(WCHAR_H) \ +EXTRA_DIST = m4/gnulib-cache.m4 alignof.h alloca.c alloca.in.h \ + arpa_inet.in.h btowc.c c-strtod.c c-strtod.h cloexec.c \ + cloexec.h basename.c dirname.c dirname.h stripslash.c \ + errno.in.h error.c error.h exitfail.c exitfail.h fcntl.in.h \ + creat-safer.c fcntl--.h fcntl-safer.h open-safer.c float.in.h \ + floor.c floorf.c fsusage.c fsusage.h gai_strerror.c \ + getaddrinfo.c gethostname.c getloadavg.c getopt.c getopt.in.h \ + getopt1.c getopt_int.h $(top_srcdir)/build-aux/config.rpath \ + $(top_srcdir)/build-aux/config.rpath inet_ntop.c intprops.h \ + $(top_srcdir)/build-aux/link-warning.h config.charset \ + ref-add.sin ref-del.sin malloc.c malloc.c math.in.h mbrtowc.c \ + mbsinit.c mktime.c mountlist.c mountlist.h netdb.in.h \ + netinet_in.in.h open.c regcomp.c regex.c regex.h \ + regex_internal.c regex_internal.h regexec.c safe-read.c \ + safe-read.h safe-write.c safe-write.h snprintf.c stdbool.in.h \ + stdint.in.h stdio-write.c stdio.in.h stdlib.in.h strdup.c \ + streq.h strerror.c string.in.h strndup.c strnlen.c \ + sys_socket.in.h time.in.h time_r.c timegm.c unistd.in.h \ + dup-safer.c fd-safer.c pipe-safer.c unistd--.h unistd-safer.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 vsnprintf.c wchar.in.h wcrtomb.c \ + wctype.in.h write.c xalloc.h xmalloc.c +BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) configmake.h $(ERRNO_H) \ + $(FCNTL_H) $(FLOAT_H) $(GETOPT_H) math.h $(NETDB_H) \ + $(NETINET_IN_H) $(STDBOOL_H) $(STDINT_H) stdio.h stdlib.h \ + string.h $(SYS_SOCKET_H) time.h unistd.h $(WCHAR_H) \ $(WCTYPE_H) SUFFIXES = .sed .sin MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \ - arpa/inet.h-t float.h float.h-t getopt.h getopt.h-t math.h \ - math.h-t netinet/in.h netinet/in.h-t stdbool.h stdbool.h-t \ + arpa/inet.h-t errno.h errno.h-t fcntl.h fcntl.h-t float.h \ + float.h-t getopt.h getopt.h-t math.h math.h-t netdb.h \ + netdb.h-t netinet/in.h netinet/in.h-t stdbool.h stdbool.h-t \ stdint.h stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t \ - string.h string.h-t sys/socket.h sys/socket.h-t unistd.h \ - unistd.h-t wchar.h wchar.h-t wctype.h wctype.h-t + string.h string.h-t sys/socket.h sys/socket.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 CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \ ref-del.sed @@ -624,31 +827,29 @@ MAINTAINERCLEANFILES = # directory contains no libintl.h file) or when the project does not use # "gettextize --intl". AM_CPPFLAGS = -I$(top_builddir)/intl +AM_CFLAGS = libgnu_a_SOURCES = base64.h base64.c full-read.h full-read.c \ full-write.h full-write.c gettext.h localcharset.h \ - localcharset.c size_max.h xalloc-die.c xsize.h xstrndup.h \ - xstrndup.c + localcharset.c size_max.h verify.h xalloc-die.c xsize.h \ + xstrndup.h xstrndup.c libgnu_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@ libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@ -EXTRA_libgnu_a_SOURCES = alloca.c c-strtod.c cloexec.c basename.c \ - dirname.c stripslash.c error.c exitfail.c creat-safer.c \ - open-safer.c floor.c floorf.c fsusage.c gai_strerror.c \ - getaddrinfo.c gethostname.c getloadavg.c getopt.c getopt1.c \ - inet_ntop.c malloc.c malloc.c mountlist.c regcomp.c regex.c \ +EXTRA_libgnu_a_SOURCES = alloca.c btowc.c c-strtod.c cloexec.c \ + basename.c dirname.c stripslash.c error.c exitfail.c \ + creat-safer.c open-safer.c floor.c floorf.c fsusage.c \ + gai_strerror.c getaddrinfo.c gethostname.c getloadavg.c \ + getopt.c getopt1.c inet_ntop.c malloc.c malloc.c mbrtowc.c \ + mbsinit.c mktime.c mountlist.c open.c regcomp.c regex.c \ regex_internal.c regexec.c safe-read.c safe-write.c snprintf.c \ - strdup.c strerror.c strndup.c strnlen.c dup-safer.c fd-safer.c \ - pipe-safer.c asnprintf.c printf-args.c printf-parse.c \ - vasnprintf.c asprintf.c vasprintf.c vsnprintf.c xmalloc.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__ || 60000000 <= __DECC_VER) + stdio-write.c strdup.c strerror.c strndup.c strnlen.c time_r.c \ + timegm.c dup-safer.c fd-safer.c pipe-safer.c asnprintf.c \ + printf-args.c printf-parse.c vasnprintf.c asprintf.c \ + vasprintf.c vsnprintf.c wcrtomb.c write.c xmalloc.c LINK_WARNING_H = $(top_srcdir)/build-aux/link-warning.h charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_tmp = $(DESTDIR)$(libdir)/charset.tmp all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am + $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .sed .sin .c .lo .o .obj @@ -710,6 +911,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strtod.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cloexec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat-safer.Po@am__quote@ @@ -732,8 +934,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@ @@ -744,14 +950,19 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safe-read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safe-write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio-write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_r.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timegm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vsnprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcrtomb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup.Po@am__quote@ @@ -787,6 +998,77 @@ distclean-libtool: -rm -f libtool uninstall-info-am: +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; 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; \ + (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" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -797,10 +1079,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) mkid -fID $$unique tags: TAGS -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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 || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -813,7 +1108,7 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$tags $$unique; \ fi ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ @@ -836,7 +1131,7 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - $(mkdir_p) $(distdir)/$(top_srcdir)/build-aux + $(mkdir_p) $(distdir)/$(top_srcdir)/build-aux $(distdir)/m4 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ @@ -863,21 +1158,37 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done check-am: all-am check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am + $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) all-local -installdirs: +installdirs: installdirs-recursive +installdirs-am: install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am + $(MAKE) $(AM_MAKEFLAGS) 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-am +installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ @@ -898,24 +1209,24 @@ maintainer-clean-generic: @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-am +clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ clean-noinstLTLIBRARIES mostlyclean-am -distclean: distclean-am +distclean: distclean-recursive -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags -dvi: dvi-am +dvi: dvi-recursive dvi-am: -html: html-am +html: html-recursive -info: info-am +info: info-recursive info-am: @@ -923,44 +1234,49 @@ install-data-am: install-exec-am: install-exec-local -install-info: install-info-am +install-info: install-info-recursive install-man: installcheck-am: -maintainer-clean: maintainer-clean-am +maintainer-clean: maintainer-clean-recursive -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-am +mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool mostlyclean-local -pdf: pdf-am +pdf: pdf-recursive pdf-am: -ps: ps-am +ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-local -.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ - clean-generic clean-libtool clean-noinstLIBRARIES \ - clean-noinstLTLIBRARIES ctags 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-exec install-exec-am \ - install-exec-local install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - mostlyclean-local pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am uninstall-local +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-local check \ + check-am clean clean-generic clean-libtool \ + clean-noinstLIBRARIES clean-noinstLTLIBRARIES clean-recursive \ + ctags ctags-recursive distclean distclean-compile \ + distclean-generic distclean-libtool distclean-recursive \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-exec-local install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-local mostlyclean-recursive \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-info-am uninstall-local # We need the following in order to create when the system @@ -973,11 +1289,20 @@ alloca.h: alloca.in.h # We need the following in order to create when the system # doesn't have one. -arpa/inet.h: +arpa/inet.h: arpa_inet.in.h @MKDIR_P@ arpa rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - echo '#include '; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|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''@|$(GNULIB_INET_NTOP)|g' \ + -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \ + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/arpa_inet.in.h; \ } > $@-t mv $@-t $@ @@ -999,7 +1324,7 @@ arpa/inet.h: # The Automake-defined pkg* macros are appended, in the order # listed in the Automake 1.10a+ documentation. configmake.h: Makefile - rm -f $@-t $@ + rm -f $@-t { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#define PREFIX "$(prefix)"'; \ echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ @@ -1029,6 +1354,42 @@ configmake.h: Makefile echo '#define PKGLIBDIR "$(pkglibdir)"'; \ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ } | sed '/""/d' > $@-t + if test -f $@ && cmp $@-t $@ > /dev/null; then \ + rm -f $@-t; \ + else \ + rm -f $@; mv $@-t $@; \ + fi + +# We need the following in order to create when the system +# doesn't have one that is POSIX compliant. +errno.h: errno.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|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 + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +fcntl.h: fcntl.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + < $(srcdir)/fcntl.in.h; \ + } > $@-t mv $@-t $@ # We need the following in order to create when the system @@ -1036,7 +1397,8 @@ configmake.h: Makefile float.h: float.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ < $(srcdir)/float.in.h; \ } > $@-t @@ -1058,21 +1420,37 @@ getopt.h: getopt.in.h # avoid installing it. all-local: charset.alias ref-add.sed ref-del.sed -install-exec-local: all-local - test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) +install-exec-local: install-exec-localcharset +install-exec-localcharset: all-local + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ if test -f $(charset_alias); then \ sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ else \ - if test $(GLIBC21) = no; then \ + if $$need_charset_alias; then \ sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ fi ; \ fi -uninstall-local: all-local +uninstall-local: uninstall-localcharset +uninstall-localcharset: all-local if test -f $(charset_alias); then \ sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ if grep '^# Packages using this file: $$' $(charset_tmp) \ @@ -1098,7 +1476,8 @@ charset.alias: config.charset math.h: math.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_MATH_H''@|$(NEXT_MATH_H)|g' \ -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \ -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \ @@ -1107,6 +1486,11 @@ math.h: math.in.h -e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \ -e 's|@''GNULIB_FREXPL''@|$(GNULIB_FREXPL)|g' \ -e 's|@''GNULIB_ISFINITE''@|$(GNULIB_ISFINITE)|g' \ + -e 's|@''GNULIB_ISINF''@|$(GNULIB_ISINF)|g' \ + -e 's|@''GNULIB_ISNAN''@|$(GNULIB_ISNAN)|g' \ + -e 's|@''GNULIB_ISNANF''@|$(GNULIB_ISNANF)|g' \ + -e 's|@''GNULIB_ISNAND''@|$(GNULIB_ISNAND)|g' \ + -e 's|@''GNULIB_ISNANL''@|$(GNULIB_ISNANL)|g' \ -e 's|@''GNULIB_LDEXPL''@|$(GNULIB_LDEXPL)|g' \ -e 's|@''GNULIB_MATHL''@|$(GNULIB_MATHL)|g' \ -e 's|@''GNULIB_ROUND''@|$(GNULIB_ROUND)|g' \ @@ -1116,6 +1500,9 @@ math.h: math.in.h -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \ -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \ -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|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_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ @@ -1129,32 +1516,56 @@ math.h: math.in.h -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' \ -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \ -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|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_ISFINITE''@|$(REPLACE_ISFINITE)|g' \ + -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \ + -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \ -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \ + -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|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_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/math.in.h; \ } > $@-t mv $@-t $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +netdb.h: netdb.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \ + -e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \ + -e 's|@''GNULIB_GETADDRINFO''@|$(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' \ + < $(srcdir)/netdb.in.h; \ + } > $@-t + mv $@-t $@ + # We need the following in order to create when the system # doesn't have one. netinet/in.h: netinet_in.in.h @MKDIR_P@ netinet rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|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; \ @@ -1176,7 +1587,8 @@ stdint.h: stdint.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ - -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ @@ -1184,6 +1596,7 @@ stdint.h: stdint.in.h -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/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' \ @@ -1206,17 +1619,26 @@ stdint.h: stdint.in.h stdio.h: stdio.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ + -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \ -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \ -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \ -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \ -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \ -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \ -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ + -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ + -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ + -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \ -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \ -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \ @@ -1224,8 +1646,18 @@ stdio.h: stdio.in.h -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \ -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \ -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \ + -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \ + -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \ + -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \ + -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \ + -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \ + -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \ + -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \ -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \ -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \ + -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \ + -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \ + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ @@ -1236,8 +1668,14 @@ stdio.h: stdio.in.h -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \ -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ @@ -1245,9 +1683,11 @@ stdio.h: stdio.in.h -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/stdio.in.h; \ } > $@-t @@ -1258,26 +1698,45 @@ stdio.h: stdio.in.h stdlib.h: stdlib.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ + -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ + -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ + -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ + -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ + -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ + -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ + -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|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_UNSETENV''@|$(HAVE_UNSETENV)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/stdlib.in.h; \ @@ -1289,7 +1748,8 @@ stdlib.h: stdlib.in.h string.h: string.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \ -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \ @@ -1308,6 +1768,7 @@ string.h: string.in.h -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \ -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \ -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \ + -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \ -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \ -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \ -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \ @@ -1321,9 +1782,11 @@ string.h: string.in.h -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \ -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \ -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \ + -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|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_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' \ @@ -1337,8 +1800,10 @@ string.h: string.in.h -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ @@ -1352,48 +1817,108 @@ string.h: string.in.h sys/socket.h: sys_socket.in.h @MKDIR_P@ sys { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|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''@|$(GNULIB_CLOSE)|g' \ + -e 's|@''GNULIB_SOCKET''@|$(GNULIB_SOCKET)|g' \ + -e 's|@''GNULIB_CONNECT''@|$(GNULIB_CONNECT)|g' \ + -e 's|@''GNULIB_ACCEPT''@|$(GNULIB_ACCEPT)|g' \ + -e 's|@''GNULIB_BIND''@|$(GNULIB_BIND)|g' \ + -e 's|@''GNULIB_GETPEERNAME''@|$(GNULIB_GETPEERNAME)|g' \ + -e 's|@''GNULIB_GETSOCKNAME''@|$(GNULIB_GETSOCKNAME)|g' \ + -e 's|@''GNULIB_GETSOCKOPT''@|$(GNULIB_GETSOCKOPT)|g' \ + -e 's|@''GNULIB_LISTEN''@|$(GNULIB_LISTEN)|g' \ + -e 's|@''GNULIB_RECV''@|$(GNULIB_RECV)|g' \ + -e 's|@''GNULIB_SEND''@|$(GNULIB_SEND)|g' \ + -e 's|@''GNULIB_RECVFROM''@|$(GNULIB_RECVFROM)|g' \ + -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \ + -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \ + -e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/sys_socket.in.h; \ } > $@-t mv -f $@-t $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +time.h: time.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ + -e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ + -e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \ + -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|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' \ + < $(srcdir)/time.in.h; \ + } > $@-t + mv $@-t $@ + # We need the following in order to create an empty placeholder for # when the system doesn't have one. unistd.h: unistd.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ - -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ + -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ + -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ + -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ + -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ + -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ + -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ + -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ + -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ + -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/unistd.in.h; \ } > $@-t mv $@-t $@ @@ -1403,11 +1928,44 @@ unistd.h: unistd.in.h wchar.h: wchar.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ - -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \ + -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \ + -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \ + -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \ + -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \ + -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \ + -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \ + -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \ + -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \ + -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \ -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ + -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_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + -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_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 '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/wchar.in.h; \ @@ -1420,10 +1978,12 @@ wctype.h: wctype.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ - -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ < $(srcdir)/wctype.in.h; \ } > $@-t mv $@-t $@ diff --git a/gl/alignof.h b/gl/alignof.h new file mode 100644 index 0000000..896382b --- /dev/null +++ b/gl/alignof.h @@ -0,0 +1,33 @@ +/* Determine alignment of types. + Copyright (C) 2003-2004, 2006, 2009 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, 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 02110-1301, USA. */ + +#ifndef _ALIGNOF_H +#define _ALIGNOF_H + +#include + +/* Determine the alignment of a type at compile time. */ +#if defined __GNUC__ +# define alignof __alignof__ +#elif defined __cplusplus + template struct alignof_helper { char __slot1; type __slot2; }; +# define alignof(type) offsetof (alignof_helper, __slot2) +#else +# define alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) +#endif + +#endif /* _ALIGNOF_H */ diff --git a/gl/alloca.in.h b/gl/alloca.in.h index 8278288..6269607 100644 --- a/gl/alloca.in.h +++ b/gl/alloca.in.h @@ -1,6 +1,6 @@ /* Memory allocation on the stack. - Copyright (C) 1995, 1999, 2001-2004, 2006-2007 Free Software + Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -42,6 +42,8 @@ # elif defined _MSC_VER # include # define alloca _alloca +# elif defined __DECC && defined __VMS +# define alloca __ALLOCA # else # include # ifdef __cplusplus diff --git a/gl/inet_ntop.h b/gl/arpa_inet.in.h similarity index 55% rename from gl/inet_ntop.h rename to gl/arpa_inet.in.h index 2897bb4..ac93399 100644 --- a/gl/inet_ntop.h +++ b/gl/arpa_inet.in.h @@ -1,5 +1,6 @@ -/* Convert internet address from internal to printable, presentable format. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. +/* A GNU-like . + + Copyright (C) 2005-2006, 2008 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 @@ -15,11 +16,34 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#ifndef _GL_ARPA_INET_H +/* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc + under MinGW. */ +#include + +#if @HAVE_ARPA_INET_H@ + +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@ + +#endif + +#ifndef _GL_ARPA_INET_H +#define _GL_ARPA_INET_H + +/* The definition of GL_LINK_WARNING is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if @GNULIB_INET_NTOP@ +# if !@HAVE_DECL_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. @@ -35,8 +59,32 @@ For more details, see the POSIX:2001 specification . */ - -#if !HAVE_DECL_INET_NTOP extern const char *inet_ntop (int af, const void *restrict src, char *restrict dst, socklen_t cnt); +# endif +#elif defined GNULIB_POSIXCHECK +# undef inet_ntop +# define inet_ntop(af,src,dst,cnt) \ + (GL_LINK_WARNING ("inet_ntop is unportable - " \ + "use gnulib module inet_ntop for portability"), \ + inet_ntop (af, src, dst, cnt)) #endif + +#if @GNULIB_INET_PTON@ +# if !@HAVE_DECL_INET_PTON@ +extern int inet_pton (int af, const char *restrict src, void *restrict dst); +# endif +#elif defined GNULIB_POSIXCHECK +# undef inet_pton +# define inet_pton(af,src,dst) \ + (GL_LINK_WARNING ("inet_pton is unportable - " \ + "use gnulib module inet_pton for portability"), \ + inet_pton (af, src, dst)) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_ARPA_INET_H */ +#endif /* _GL_ARPA_INET_H */ diff --git a/gl/base64.c b/gl/base64.c index e67075d..42ccc9c 100644 --- a/gl/base64.c +++ b/gl/base64.c @@ -52,6 +52,8 @@ /* Get UCHAR_MAX. */ #include +#include + /* C89 compliant way to cast 'char' to 'unsigned char'. */ static inline unsigned char to_uchar (char ch) @@ -300,89 +302,237 @@ isbase64 (char ch) return uchar_in_range (to_uchar (ch)) && 0 <= b64[to_uchar (ch)]; } -/* Decode base64 encoded input array IN of length INLEN to output - array OUT that can hold *OUTLEN bytes. 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 characters are - encountered, decoding is stopped and false is returned. This means - that, when applicable, you must remove any line terminators that is - part of the data stream before calling this function. */ -bool -base64_decode (const char *restrict in, size_t inlen, - char *restrict out, size_t *outlen) +/* Initialize decode-context buffer, CTX. */ +void +base64_decode_ctx_init (struct base64_decode_context *ctx) { - size_t outleft = *outlen; + ctx->i = 0; +} - while (inlen >= 2) +/* 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 inline char * +get_4 (struct base64_decode_context *ctx, + char const *restrict *in, char const *restrict in_end, + size_t *n_non_newline) +{ + if (ctx->i == 4) + ctx->i = 0; + + if (ctx->i == 0) { - if (!isbase64 (in[0]) || !isbase64 (in[1])) - break; - - if (outleft) + char const *t = *in; + if (4 <= in_end - *in && memchr (t, '\n', 4) == NULL) { - *out++ = ((b64[to_uchar (in[0])] << 2) - | (b64[to_uchar (in[1])] >> 4)); - outleft--; + /* 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 inline bool +decode_4 (char const *restrict in, size_t inlen, + char *restrict *outp, size_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 == 2) - break; + if (inlen == 3) + return_false; - if (in[2] == '=') + if (in[3] == '=') { if (inlen != 4) - break; - - if (in[3] != '=') - break; - + return_false; } else { - if (!isbase64 (in[2])) - break; + if (!isbase64 (in[3])) + return_false; - if (outleft) + if (*outleft) { - *out++ = (((b64[to_uchar (in[1])] << 4) & 0xf0) - | (b64[to_uchar (in[2])] >> 2)); - outleft--; + *out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0) + | b64[to_uchar (in[3])]); + --*outleft; } + } + } - if (inlen == 3) - break; + *outp = out; + return true; +} - if (in[3] == '=') +/* 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, size_t inlen, + char *restrict out, size_t *outlen) +{ + size_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) + { + size_t outleft_save = outleft; + if (ctx_i == 0 && !flush_ctx) + { + while (true) { - if (inlen != 4) - break; - } - else - { - if (!isbase64 (in[3])) + /* 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; - if (outleft) - { - *out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0) - | b64[to_uchar (in[3])]); - outleft--; - } + in += 4; + inlen -= 4; } } - 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; - if (inlen != 0) - return false; - - return true; + return inlen == 0; } /* Allocate an output buffer in *OUT, and decode the base64 encoded @@ -397,12 +547,13 @@ base64_decode (const char *restrict in, size_t inlen, input was invalid, in which case *OUT is NULL and *OUTLEN is undefined. */ bool -base64_decode_alloc (const char *in, size_t inlen, char **out, - size_t *outlen) +base64_decode_alloc_ctx (struct base64_decode_context *ctx, + const char *in, size_t inlen, char **out, + size_t *outlen) { - /* This may allocate a few bytes too much, depending on input, - but it's not worth the extra CPU time to compute the exact amount. - The exact amount is 3 * inlen / 4, minus 1 if the input ends + /* 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 / 4, minus 1 if the input ends with "=" and minus another 1 if the input ends with "==". Dividing before multiplying avoids the possibility of overflow. */ size_t needlen = 3 * (inlen / 4) + 2; @@ -411,7 +562,7 @@ base64_decode_alloc (const char *in, size_t inlen, char **out, if (!*out) return true; - if (!base64_decode (in, inlen, *out, &needlen)) + if (!base64_decode_ctx (ctx, in, inlen, *out, &needlen)) { free (*out); *out = NULL; diff --git a/gl/base64.h b/gl/base64.h index 1f9b203..63b6abc 100644 --- a/gl/base64.h +++ b/gl/base64.h @@ -29,6 +29,12 @@ integer >= n/k, i.e., the ceiling of n/k. */ # define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4) +struct base64_decode_context +{ + unsigned int i; + char buf[4]; +}; + extern bool isbase64 (char ch); extern void base64_encode (const char *restrict in, size_t inlen, @@ -36,10 +42,20 @@ extern void base64_encode (const char *restrict in, size_t inlen, extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out); -extern bool base64_decode (const char *restrict in, size_t inlen, - char *restrict out, size_t *outlen); +extern void base64_decode_ctx_init (struct base64_decode_context *ctx); -extern bool base64_decode_alloc (const char *in, size_t inlen, - char **out, size_t *outlen); +extern bool base64_decode_ctx (struct base64_decode_context *ctx, + const char *restrict in, size_t inlen, + char *restrict out, size_t *outlen); + +extern bool base64_decode_alloc_ctx (struct base64_decode_context *ctx, + const char *in, size_t inlen, + char **out, size_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) #endif /* BASE64_H */ diff --git a/gl/btowc.c b/gl/btowc.c new file mode 100644 index 0000000..7f3b966 --- /dev/null +++ b/gl/btowc.c @@ -0,0 +1,38 @@ +/* Convert unibyte character to wide character. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + 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 . */ + +#include + +/* Specification. */ +#include + +#include + +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/c-strtod.c b/gl/c-strtod.c index 95624cc..51e996e 100644 --- a/gl/c-strtod.c +++ b/gl/c-strtod.c @@ -1,6 +1,6 @@ /* Convert string to double, using the C locale. - Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2006, 2009 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 @@ -21,10 +21,10 @@ #include "c-strtod.h" +#include #include #include - -#include "xalloc.h" +#include #if LONG # define C_STRTOD c_strtold @@ -43,6 +43,25 @@ # define STRTOD strtod #endif +#ifdef LC_ALL_MASK + +/* Cache for the C locale object. + Marked volatile so that different threads see the same value + (avoids locking). */ +static volatile locale_t c_locale_cache; + +/* Return the C locale object, or (locale_t) 0 with errno set + if it cannot be created. */ +static inline locale_t +c_locale (void) +{ + if (!c_locale_cache) + c_locale_cache = newlocale (LC_ALL_MASK, "C", (locale_t) 0); + return c_locale_cache; +} + +#endif + DOUBLE C_STRTOD (char const *nptr, char **endptr) { @@ -50,9 +69,15 @@ C_STRTOD (char const *nptr, char **endptr) #ifdef LC_ALL_MASK - locale_t c_locale = newlocale (LC_ALL_MASK, "C", 0); - r = STRTOD_L (nptr, endptr, c_locale); - freelocale (c_locale); + locale_t locale = c_locale (); + if (!locale) + { + if (endptr) + *endptr = (char *) nptr; + return 0; /* errno is set here */ + } + + r = STRTOD_L (nptr, endptr, locale); #else @@ -60,7 +85,13 @@ C_STRTOD (char const *nptr, char **endptr) if (saved_locale) { - saved_locale = xstrdup (saved_locale); + saved_locale = strdup (saved_locale); + if (saved_locale == NULL) + { + if (endptr) + *endptr = (char *) nptr; + return 0; /* errno is set here */ + } setlocale (LC_NUMERIC, "C"); } @@ -68,8 +99,11 @@ C_STRTOD (char const *nptr, char **endptr) if (saved_locale) { + int saved_errno = errno; + setlocale (LC_NUMERIC, saved_locale); free (saved_locale); + errno = saved_errno; } #endif diff --git a/gl/c-strtod.h b/gl/c-strtod.h index ca9a9e7..2b3f847 100644 --- a/gl/c-strtod.h +++ b/gl/c-strtod.h @@ -1,2 +1,37 @@ -double c_strtod (char const *, char **); -long double c_strtold (char const *, char **); +/* Convert string to double, using the C locale. + + Copyright (C) 2003-2004, 2009 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 . */ + +/* Parse the initial portion of the string pointed to by NPTR as a floating- + point number (in decimal or hexadecimal notation), like in the C locale: + accepting only the ASCII digits '0'..'9', and only '.' as decimal point + character. + If ENDPTR is not NULL, set *ENDPTR to point to the first byte beyond the + parsed number or to NPTR if the string does not start with a parseable + number. + Return value: + - If successful, return the value as a double or 'long double', + respectively, and don't modify errno. + - In case of overflow, return ±HUGE_VAL or ±HUGE_VALL, respectively, and + set errno to ERANGE. + - In case of underflow, return a value very near to 0 and set errno to + ERANGE. + - If the string does not start with a number at all, return 0 (and recall + that if ENDPTR != NULL, *ENDPTR is set to NPTR), and maybe set errno to + EINVAL. + - In case of other error, return 0 and set errno, for example to ENOMEM. */ +extern double c_strtod (char const *nptr, char **endptr); +extern long double c_strtold (char const *nptr, char **endptr); diff --git a/gl/config.charset b/gl/config.charset index c233788..7f91212 100755 --- a/gl/config.charset +++ b/gl/config.charset @@ -1,7 +1,7 @@ #! /bin/sh # Output a system dependent table of character encoding aliases. # -# Copyright (C) 2000-2004, 2006-2007 Free Software Foundation, Inc. +# Copyright (C) 2000-2004, 2006-2009 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 @@ -63,12 +63,13 @@ # CP922 aix # CP932 aix woe32 dos # CP943 aix -# CP949 osf woe32 dos +# CP949 osf darwin woe32 dos # CP950 woe32 dos # CP1046 aix # CP1124 aix # CP1125 dos # CP1129 aix +# CP1131 darwin # CP1250 woe32 # CP1251 glibc solaris netbsd openbsd darwin woe32 # CP1252 aix woe32 @@ -82,15 +83,17 @@ # EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin # EUC-TW glibc aix hpux irix osf solaris netbsd # BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin -# BIG5-HKSCS glibc solaris -# GBK glibc aix osf solaris woe32 dos -# GB18030 glibc solaris netbsd +# BIG5-HKSCS glibc solaris darwin +# GBK glibc aix osf solaris darwin woe32 dos +# GB18030 glibc solaris netbsd darwin # SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin # JOHAB glibc solaris woe32 # TIS-620 glibc aix hpux osf solaris # VISCII Y glibc # TCVN5712-1 glibc +# ARMSCII-8 glibc darwin # GEORGIAN-PS glibc +# PT154 glibc # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux @@ -449,7 +452,8 @@ case "$os" in echo "ko_KR.EUC EUC-KR" ;; darwin*) - # Darwin 7.5 has nl_langinfo(CODESET), but it is useless: + # 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. @@ -476,10 +480,40 @@ case "$os" in # 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. + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-13 ISO-8859-13" + echo "ISO8859-15 ISO-8859-15" + echo "KOI8-R KOI8-R" + echo "KOI8-U KOI8-U" + echo "CP866 CP866" + echo "CP949 CP949" + echo "CP1131 CP1131" + echo "CP1251 CP1251" + echo "eucCN GB2312" + echo "GB2312 GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "Big5 BIG5" + echo "Big5HKSCS BIG5-HKSCS" + echo "GBK GBK" + echo "GB18030 GB18030" + echo "SJIS SHIFT_JIS" + echo "ARMSCII-8 ARMSCII-8" + echo "PT154 PT154" + #echo "ISCII-DEV ?" echo "* UTF-8" ;; - beos*) - # BeOS has a single locale, and it has UTF-8 encoding. + beos* | haiku*) + # BeOS and Haiku have a single locale, and it has UTF-8 encoding. echo "* UTF-8" ;; msdosdjgpp*) diff --git a/gl/dup-safer.c b/gl/dup-safer.c index a690851..7d9b2be 100644 --- a/gl/dup-safer.c +++ b/gl/dup-safer.c @@ -1,6 +1,7 @@ /* Invoke dup, but avoid some glitches. - Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2004, 2005, 2006, 2009 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 @@ -24,9 +25,6 @@ #include #include -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif /* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. */ diff --git a/gl/errno.in.h b/gl/errno.in.h new file mode 100644 index 0000000..51ac662 --- /dev/null +++ b/gl/errno.in.h @@ -0,0 +1,155 @@ +/* A POSIX-like . + + Copyright (C) 2008 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, 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 02110-1301, USA. */ + +#ifndef _GL_ERRNO_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_ERRNO_H@ + +#ifndef _GL_ERRNO_H +#define _GL_ERRNO_H + + +/* On native Windows platforms, many macros are not defined. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */ +# define EWOULDBLOCK EAGAIN + +/* Values >= 100 seem safe to use. */ +# define ETXTBSY 100 +# define GNULIB_defined_ETXTBSY 1 + +/* These are intentionally the same values as the WSA* error numbers, defined + in . */ +# define EINPROGRESS 10036 +# define EALREADY 10037 +# define ENOTSOCK 10038 +# define EDESTADDRREQ 10039 +# define EMSGSIZE 10040 +# define EPROTOTYPE 10041 +# define ENOPROTOOPT 10042 +# define EPROTONOSUPPORT 10043 +# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */ +# define EOPNOTSUPP 10045 +# define EPFNOSUPPORT 10046 /* not required by POSIX */ +# define EAFNOSUPPORT 10047 +# define EADDRINUSE 10048 +# define EADDRNOTAVAIL 10049 +# define ENETDOWN 10050 +# define ENETUNREACH 10051 +# define ENETRESET 10052 +# define ECONNABORTED 10053 +# define ECONNRESET 10054 +# define ENOBUFS 10055 +# define EISCONN 10056 +# define ENOTCONN 10057 +# define ESHUTDOWN 10058 /* not required by POSIX */ +# define ETOOMANYREFS 10059 /* not required by POSIX */ +# define ETIMEDOUT 10060 +# define ECONNREFUSED 10061 +# define ELOOP 10062 +# define EHOSTDOWN 10064 /* not required by POSIX */ +# define EHOSTUNREACH 10065 +# 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_ESOCK 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. + 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 ECANCELED +# define ECANCELED 2008 +# define GNULIB_defined_ECANCELED 1 +# endif + + +#endif /* _GL_ERRNO_H */ +#endif /* _GL_ERRNO_H */ diff --git a/gl/fcntl.in.h b/gl/fcntl.in.h new file mode 100644 index 0000000..fd7520e --- /dev/null +++ b/gl/fcntl.in.h @@ -0,0 +1,144 @@ +/* Like , but with non-working flags defined to 0. + + Copyright (C) 2006-2008 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 . */ + +/* written by Paul Eggert */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +#if defined __need_system_fcntl_h +/* Special invocation convention. */ + +#include +#include +#include +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_FCNTL_H + +#include +#include +#include +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +#ifndef _GL_FCNTL_H +#define _GL_FCNTL_H + + +/* Declare overridden functions. */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if @GNULIB_OPEN@ +# if @REPLACE_OPEN@ +# undef open +# define open rpl_open +extern int open (const char *filename, int flags, ...); +# endif +#endif + +#ifdef FCHDIR_REPLACEMENT +/* gnulib internal function. */ +extern void _gl_register_fd (int fd, const char *filename); +#endif + +#ifdef __cplusplus +} +#endif + + +/* Fix up the O_* macros. */ + +#if !defined O_DIRECT && defined O_DIRECTIO +/* Tru64 spells it `O_DIRECTIO'. */ +# define O_DIRECT O_DIRECTIO +#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_NDELAY +# define O_NDELAY 0 +#endif + +#ifndef O_NOATIME +# define O_NOATIME 0 +#endif + +#ifndef O_NONBLOCK +# define O_NONBLOCK O_NDELAY +#endif + +#ifndef O_NOCTTY +# define O_NOCTTY 0 +#endif + +#ifndef O_NOFOLLOW +# define O_NOFOLLOW 0 +#endif + +#ifndef O_NOLINKS +# define O_NOLINKS 0 +#endif + +#ifndef O_RSYNC +# define O_RSYNC 0 +#endif + +#ifndef O_SYNC +# define O_SYNC 0 +#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 + + +#endif /* _GL_FCNTL_H */ +#endif /* _GL_FCNTL_H */ +#endif diff --git a/gl/fd-safer.c b/gl/fd-safer.c index df38c8f..fb99001 100644 --- a/gl/fd-safer.c +++ b/gl/fd-safer.c @@ -1,6 +1,6 @@ /* Return a safer copy of a file descriptor. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2009 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 @@ -24,12 +24,6 @@ #include #include -#ifndef STDIN_FILENO -# define STDIN_FILENO 0 -#endif -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif /* Return FD, unless FD would be a copy of standard input, output, or error; in that case, return a duplicate of FD, closing FD. On diff --git a/gl/float.in.h b/gl/float.in.h index 2504032..9ba2bce 100644 --- a/gl/float.in.h +++ b/gl/float.in.h @@ -1,6 +1,6 @@ /* A correct . - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -17,6 +17,10 @@ #ifndef _GL_FLOAT_H +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_FLOAT_H@ diff --git a/gl/fsusage.c b/gl/fsusage.c index 23d40ea..db0d3bc 100644 --- a/gl/fsusage.c +++ b/gl/fsusage.c @@ -1,6 +1,6 @@ /* fsusage.c -- return space usage of mounted file systems - Copyright (C) 1991, 1992, 1996, 1998, 1999, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -232,6 +232,7 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp) #endif + (void) disk; /* avoid argument-unused warning */ return 0; } diff --git a/gl/gai_strerror.c b/gl/gai_strerror.c index 9e4abbe..afbcdbb 100644 --- a/gl/gai_strerror.c +++ b/gl/gai_strerror.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell , 1997. @@ -18,13 +18,10 @@ #ifndef _LIBC # include -# include "getaddrinfo.h" #endif #include -#ifdef HAVE_NETDB_H -# include -#endif +#include #ifdef _LIBC # include @@ -53,7 +50,7 @@ values[] = { EAI_SOCKTYPE, N_("ai_socktype not supported") }, { EAI_SYSTEM, N_("System error") }, { EAI_OVERFLOW, N_("Argument buffer too small") }, -#ifdef __USE_GNU +#ifdef EAI_INPROGRESS { EAI_INPROGRESS, N_("Processing request in progress") }, { EAI_CANCELED, N_("Request canceled") }, { EAI_NOTCANCELED, N_("Request not canceled") }, diff --git a/gl/getaddrinfo.c b/gl/getaddrinfo.c index 04f0ac2..f09cf9e 100644 --- a/gl/getaddrinfo.c +++ b/gl/getaddrinfo.c @@ -1,5 +1,5 @@ /* Get address information (partial implementation). - Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007 Free Software + Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Simon Josefsson . @@ -19,12 +19,15 @@ #include -#include "getaddrinfo.h" +#include #if HAVE_NETINET_IN_H # include #endif +/* Get inet_ntop. */ +#include + /* Get calloc. */ #include @@ -40,8 +43,6 @@ #define _(String) gettext (String) #define N_(String) String -#include "inet_ntop.h" - /* BeOS has AF_INET, but not PF_INET. */ #ifndef PF_INET # define PF_INET AF_INET @@ -300,6 +301,22 @@ getaddrinfo (const char *restrict nodename, 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; @@ -326,7 +343,7 @@ freeaddrinfo (struct addrinfo *ai) cur = ai; ai = ai->ai_next; - if (cur->ai_canonname) free (cur->ai_canonname); + free (cur->ai_canonname); free (cur); } } diff --git a/gl/getaddrinfo.h b/gl/getaddrinfo.h deleted file mode 100644 index 050b793..0000000 --- a/gl/getaddrinfo.h +++ /dev/null @@ -1,155 +0,0 @@ -/* Get address information. - Copyright (C) 1996-2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - Contributed by Simon Josefsson . - - 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, 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 02110-1301, USA. */ - -#ifndef GETADDRINFO_H -#define GETADDRINFO_H - -/* sys/socket.h in i386-unknown-freebsd4.10 and - powerpc-apple-darwin5.5 require sys/types.h, so include it first. - Then we'll also get 'socklen_t' and 'struct sockaddr' which are - used below. */ -#include -/* Get all getaddrinfo related declarations, if available. */ -#include -#ifdef HAVE_NETDB_H -# include -#endif - -#ifndef HAVE_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. */ -}; -#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 -/* The commented out definitions below are not yet implemented in the - GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact, - cause conflicts on systems with a getaddrinfo() function which does not - define them. - - If they are restored, be sure to protect the definitions with #ifndef. */ -#define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ -#define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ -#define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ -#define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose - returned address type.. */ -#endif /* 0 */ - -/* 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 -#ifndef EAI_OVERFLOW -/* Not defined on mingw32. */ -# 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 - -#ifdef __USE_GNU -# 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 - -#if !HAVE_DECL_GETADDRINFO -/* Translate name of a service location and/or a service name to set of - socket addresses. - For more details, see the POSIX:2001 specification - . */ -extern int getaddrinfo (const char *restrict nodename, - const char *restrict servname, - const struct addrinfo *restrict hints, - struct addrinfo **restrict res); -#endif - -#if !HAVE_DECL_FREEADDRINFO -/* Free `addrinfo' structure AI including associated storage. - For more details, see the POSIX:2001 specification - . */ -extern void freeaddrinfo (struct addrinfo *ai); -#endif - -#if !HAVE_DECL_GAI_STRERROR -/* Convert error return from getaddrinfo() to a string. - For more details, see the POSIX:2001 specification - . */ -extern const char *gai_strerror (int ecode); -#endif - -#if !HAVE_DECL_GETNAMEINFO -/* Convert socket address to printable node and service names. - For more details, see the POSIX:2001 specification - . */ -extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, - char *restrict node, socklen_t nodelen, - char *restrict service, socklen_t servicelen, - int flags); - -#endif - -/* Possible flags for getnameinfo. */ -#ifndef NI_NUMERICHOST -# define NI_NUMERICHOST 1 -#endif -#ifndef NI_NUMERICSERV -# define NI_NUMERICSERV 2 -#endif - -#endif /* GETADDRINFO_H */ diff --git a/gl/gethostname.c b/gl/gethostname.c index 169dd4e..acff351 100644 --- a/gl/gethostname.c +++ b/gl/gethostname.c @@ -19,6 +19,9 @@ #include +/* Specification. */ +#include + #ifdef HAVE_UNAME # include #endif diff --git a/gl/getloadavg.c b/gl/getloadavg.c index 5faa8fa..5a4005c 100644 --- a/gl/getloadavg.c +++ b/gl/getloadavg.c @@ -1,8 +1,8 @@ /* Get the system load averages. Copyright (C) 1985, 1986, 1987, 1988, 1989, 1991, 1992, 1993, 1994, - 1995, 1997, 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software - Foundation, Inc. + 1995, 1997, 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free + Software Foundation, Inc. NOTE: The canonical source of this file is maintained with gnulib. Bugs can be reported to bug-gnulib@gnu.org. @@ -89,9 +89,11 @@ # include #endif +/* Specification. */ +#include + #include #include -#include /* Exclude all the code except the test program at the end if the system has its own `getloadavg' function. */ @@ -407,6 +409,7 @@ # endif /* LOAD_AVE_TYPE */ # if defined HAVE_LIBPERFSTAT +# include # include # include # ifndef SBITS @@ -618,8 +621,11 @@ getloadavg (double loadavg[], int nelem) for (elem = 0; elem < nelem; elem++) { char *endptr; - double d = c_strtod (ptr, &endptr); - if (ptr == endptr) + double d; + + errno = 0; + d = c_strtod (ptr, &endptr); + if (ptr == endptr || (d == 0 && errno != 0)) { if (elem == 0) return -1; diff --git a/gl/getopt.c b/gl/getopt.c index 3c23601..f1e6d1f 100644 --- a/gl/getopt.c +++ b/gl/getopt.c @@ -2,7 +2,7 @@ NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006 + Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006,2008 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -30,10 +30,6 @@ #include #include -#ifdef __VMS -# include -#endif - #ifdef _LIBC # include #else diff --git a/gl/getopt1.c b/gl/getopt1.c index d6a3ecf..ba115c4 100644 --- a/gl/getopt1.c +++ b/gl/getopt1.c @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006 + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -91,7 +91,7 @@ main (int argc, char **argv) { int this_option_optind = optind ? optind : 1; int option_index = 0; - static struct option long_options[] = + static const struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, diff --git a/gl/gettext.h b/gl/gettext.h index 763dd3c..8cf2dca 100644 --- a/gl/gettext.h +++ b/gl/gettext.h @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 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 @@ -63,21 +63,30 @@ 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)) diff --git a/gl/inet_ntop.c b/gl/inet_ntop.c index 3e266a2..be091ff 100644 --- a/gl/inet_ntop.c +++ b/gl/inet_ntop.c @@ -1,6 +1,6 @@ /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008 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 @@ -36,7 +36,7 @@ #include /* Specification. */ -#include "inet_ntop.h" +#include #include #include diff --git a/gl/localcharset.c b/gl/localcharset.c index 4f31948..a7ca94c 100644 --- a/gl/localcharset.c +++ b/gl/localcharset.c @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2009 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 @@ -28,13 +28,19 @@ #include #include +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */ +#endif + #if defined _WIN32 || defined __WIN32__ # define WIN32_NATIVE #endif #if defined __EMX__ /* Assume EMX program runs on OS/2, even if compiled under DOS. */ -# define OS2 +# ifndef OS2 +# define OS2 +# endif #endif #if !defined WIN32_NATIVE @@ -110,7 +116,7 @@ get_charset_aliases (void) cp = charset_aliases; if (cp == NULL) { -#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) +#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) FILE *fp; const char *dir; const char *base = "charset.alias"; @@ -211,6 +217,39 @@ get_charset_aliases (void) #else +# if defined DARWIN7 + /* To avoid the trouble of installing a file that is shared by many + GNU packages -- many packaging systems have problems with this --, + simply inline the aliases here. */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-4" "\0" "ISO-8859-4" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + "ISO8859-13" "\0" "ISO-8859-13" "\0" + "ISO8859-15" "\0" "ISO-8859-15" "\0" + "KOI8-R" "\0" "KOI8-R" "\0" + "KOI8-U" "\0" "KOI8-U" "\0" + "CP866" "\0" "CP866" "\0" + "CP949" "\0" "CP949" "\0" + "CP1131" "\0" "CP1131" "\0" + "CP1251" "\0" "CP1251" "\0" + "eucCN" "\0" "GB2312" "\0" + "GB2312" "\0" "GB2312" "\0" + "eucJP" "\0" "EUC-JP" "\0" + "eucKR" "\0" "EUC-KR" "\0" + "Big5" "\0" "BIG5" "\0" + "Big5HKSCS" "\0" "BIG5-HKSCS" "\0" + "GBK" "\0" "GBK" "\0" + "GB18030" "\0" "GB18030" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "ARMSCII-8" "\0" "ARMSCII-8" "\0" + "PT154" "\0" "PT154" "\0" + /*"ISCII-DEV" "\0" "?" "\0"*/ + "*" "\0" "UTF-8" "\0"; +# endif + # if defined VMS /* To avoid the troubles of an extra file charset.alias_vms in the sources of many GNU packages, simply inline the aliases here. */ diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4 new file mode 100644 index 0000000..d4d04d1 --- /dev/null +++ b/gl/m4/00gnulib.m4 @@ -0,0 +1,30 @@ +# 00gnulib.m4 serial 2 +dnl Copyright (C) 2009 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 such time as we can +dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE semantics. + +# AC_DEFUN_ONCE([NAME], VALUE) +# ---------------------------- +# Define NAME to expand to VALUE on the first use (whether by direct +# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses. +# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This +# definition is slower than the version in Autoconf 2.64, because it +# can only use interfaces that existed since 2.59; but it achieves the +# same effect. Quoting is necessary to avoid confusing Automake. +m4_version_prereq([2.63.263], [], +[m4_define([AC][_DEFUN_ONCE], + [AC][_DEFUN([$1], + [AC_REQUIRE([_gl_DEFUN_ONCE([$1])], + [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl +[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) + +# 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/alloca.m4 b/gl/m4/alloca.m4 index 95f54a6..4b978e1 100644 --- a/gl/m4/alloca.m4 +++ b/gl/m4/alloca.m4 @@ -1,5 +1,5 @@ -# alloca.m4 serial 8 -dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc. +# alloca.m4 serial 9 +dnl Copyright (C) 2002-2004, 2006, 2007, 2009 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. @@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_ALLOCA], ]) if test $gl_cv_rpl_alloca = yes; then dnl OK, alloca can be implemented through a compiler built-in. - AC_DEFINE([HAVE_ALLOCA], 1, + AC_DEFINE([HAVE_ALLOCA], [1], [Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution.]) ALLOCA_H=alloca.h diff --git a/gl/m4/arpa_inet_h.m4 b/gl/m4/arpa_inet_h.m4 index d01d098..a6e63df 100644 --- a/gl/m4/arpa_inet_h.m4 +++ b/gl/m4/arpa_inet_h.m4 @@ -1,18 +1,50 @@ -# arpa_inet_h.m4 serial 1 -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# arpa_inet_h.m4 serial 5 +dnl Copyright (C) 2006, 2008 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 +dnl Written by Simon Josefsson and Bruno Haible AC_DEFUN([gl_HEADER_ARPA_INET], [ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements 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 - ARPA_INET_H='' + HAVE_ARPA_INET_H=1 else ARPA_INET_H='arpa/inet.h' + HAVE_ARPA_INET_H=0 fi - AC_SUBST(ARPA_INET_H) + AC_SUBST([HAVE_ARPA_INET_H]) + dnl Execute this unconditionally, because ARPA_INET_H may be set by other + dnl modules, after this code is executed. + gl_CHECK_NEXT_HEADERS([arpa/inet.h]) +]) + +dnl Unconditionally enables the replacement of . +AC_DEFUN([gl_REPLACE_ARPA_INET_H], +[ + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + ARPA_INET_H='arpa/inet.h' +]) + +AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_ARPA_INET_H_DEFAULTS], +[ + GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP]) + GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON]) + 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]) + ARPA_INET_H=''; AC_SUBST([ARPA_INET_H]) ]) diff --git a/gl/m4/btowc.m4 b/gl/m4/btowc.m4 new file mode 100644 index 0000000..b46f74f --- /dev/null +++ b/gl/m4/btowc.m4 @@ -0,0 +1,68 @@ +# btowc.m4 serial 4 +dnl Copyright (C) 2008-2009 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]) + + AC_CHECK_FUNCS_ONCE([btowc]) + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF. + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + 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 otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none; then + AC_TRY_RUN([ +#include +#include +#include +#include +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_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([btowc]) + gl_PREREQ_BTOWC + fi +]) + +# Prerequisites of lib/btowc.c. +AC_DEFUN([gl_PREREQ_BTOWC], [ + : +]) diff --git a/gl/m4/c-strtod.m4 b/gl/m4/c-strtod.m4 index 7f206c7..ba95435 100644 --- a/gl/m4/c-strtod.m4 +++ b/gl/m4/c-strtod.m4 @@ -1,6 +1,6 @@ -# c-strtod.m4 serial 9 +# c-strtod.m4 serial 11 -# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2006, 2009 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. @@ -29,7 +29,7 @@ AC_DEFUN([gl_C99_STRTOLD], [gl_cv_func_c99_strtold=yes], [gl_cv_func_c99_strtold=no])]) if test $gl_cv_func_c99_strtold = yes; then - AC_DEFINE([HAVE_C99_STRTOLD], 1, [Define to 1 if strtold conforms to C99.]) + AC_DEFINE([HAVE_C99_STRTOLD], [1], [Define to 1 if strtold conforms to C99.]) fi ]) @@ -39,6 +39,8 @@ AC_DEFUN([gl_C_STRTOD], dnl Prerequisites of lib/c-strtod.c. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_C_INLINE]) : ]) @@ -49,5 +51,7 @@ AC_DEFUN([gl_C_STRTOLD], dnl Prerequisites of lib/c-strtold.c. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_C99_STRTOLD]) + + AC_REQUIRE([AC_C_INLINE]) : ]) diff --git a/gl/m4/codeset.m4 b/gl/m4/codeset.m4 index 223955b..413217b 100644 --- a/gl/m4/codeset.m4 +++ b/gl/m4/codeset.m4 @@ -1,5 +1,5 @@ -# codeset.m4 serial 2 (gettext-0.16) -dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc. +# codeset.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 2000-2002, 2006, 2008, 2009 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. @@ -8,14 +8,14 @@ dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ - AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET); return !cs;], - am_cv_langinfo_codeset=yes, - am_cv_langinfo_codeset=no) + [am_cv_langinfo_codeset=yes], + [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then - AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + AC_DEFINE([HAVE_LANGINFO_CODESET], [1], [Define if you have and nl_langinfo(CODESET).]) fi ]) diff --git a/gl/m4/double-slash-root.m4 b/gl/m4/double-slash-root.m4 index 69d60d0..8c6841b 100644 --- a/gl/m4/double-slash-root.m4 +++ b/gl/m4/double-slash-root.m4 @@ -1,5 +1,5 @@ -# double-slash-root.m4 serial 2 -*- Autoconf -*- -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# double-slash-root.m4 serial 4 -*- Autoconf -*- +dnl Copyright (C) 2006, 2008, 2009 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. @@ -24,15 +24,15 @@ AC_DEFUN([gl_DOUBLE_SLASH_ROOT], gl_cv_double_slash_root='unknown, assuming no' ;; esac else - set x `ls -di / //` - if test $[2] = $[4] && wc //dev/null >/dev/null 2>&1; then + 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, + 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/eoverflow.m4 b/gl/m4/eoverflow.m4 deleted file mode 100644 index 3bffd10..0000000 --- a/gl/m4/eoverflow.m4 +++ /dev/null @@ -1,70 +0,0 @@ -# eoverflow.m4 serial 2 -dnl Copyright (C) 2004, 2006 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. - -# The EOVERFLOW errno value ought to be defined in , according to -# POSIX. But some systems (like AIX 3) don't define it, and some systems -# (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined. - -# Define EOVERFLOW as a C macro and as a substituted macro in such a way that -# 1. on all systems, after inclusion of , EOVERFLOW is usable, -# 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric -# value. - -AC_DEFUN([gl_EOVERFLOW], -[ - AC_REQUIRE([AC_PROG_CC])dnl - - AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [ - AC_EGREP_CPP(yes,[ -#include -#ifdef EOVERFLOW -yes -#endif - ], have_eoverflow=1) - if test -n "$have_eoverflow"; then - dnl EOVERFLOW exists in . Don't need to define EOVERFLOW ourselves. - ac_cv_decl_EOVERFLOW=yes - else - AC_EGREP_CPP(yes,[ -#define _XOPEN_SOURCE_EXTENDED 1 -#include -#ifdef EOVERFLOW -yes -#endif - ], have_eoverflow=1) - if test -n "$have_eoverflow"; then - dnl EOVERFLOW exists but is hidden. - dnl Define it to the same value. - AC_COMPUTE_INT([ac_cv_decl_EOVERFLOW], [EOVERFLOW], [ -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include -]) - else - dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but - dnl don't define it as EINVAL, because snprintf() callers want to - dnl distinguish EINVAL and EOVERFLOW. - ac_cv_decl_EOVERFLOW=E2BIG - fi - fi - ]) - if test "$ac_cv_decl_EOVERFLOW" != yes; then - AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW], - [Define as good substitute value for EOVERFLOW.]) - EOVERFLOW="$ac_cv_decl_EOVERFLOW" - AC_SUBST(EOVERFLOW) - fi -]) - -dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. -dnl Remove this when we can assume autoconf >= 2.61. -m4_ifdef([AC_COMPUTE_INT], [], [ - AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) -]) diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4 new file mode 100644 index 0000000..16188d9 --- /dev/null +++ b/gl/m4/errno_h.m4 @@ -0,0 +1,112 @@ +# errno_h.m4 serial 5 +dnl Copyright (C) 2004, 2006, 2008, 2009 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_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 +#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 ECANCELED +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 + ERRNO_H='' + else + gl_CHECK_NEXT_HEADERS([errno.h]) + ERRNO_H='errno.h' + fi + AC_SUBST([ERRNO_H]) + 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 , 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 test -n "$ERRNO_H"; then + AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ + AC_EGREP_CPP([yes],[ +#include +#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 +#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 +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +]) + 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 +]) + +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. +dnl Remove this when we can assume autoconf >= 2.61. +m4_ifdef([AC_COMPUTE_INT], [], [ + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) +]) diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4 index bcbb3ce..ba6d5e1 100644 --- a/gl/m4/extensions.m4 +++ b/gl/m4/extensions.m4 @@ -1,7 +1,7 @@ -# serial 5 -*- Autoconf -*- +# serial 8 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2009 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. @@ -20,10 +20,12 @@ # AC_DEFINE. The goal here is to define all known feature-enabling # macros, then, if reports of conflicts are made, disable macros that # cause problems on some platforms (such as __EXTENSIONS__). -AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], +AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl AC_BEFORE([$0], [AC_RUN_IFELSE])dnl + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) if test "$MINIX" = yes; then AC_DEFINE([_POSIX_SOURCE], [1], @@ -36,6 +38,16 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl [Define to 1 if on MINIX.]) fi + dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, + dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already + dnl provided. + case "$host_os" in + hpux*) + AC_DEFINE([_XOPEN_SOURCE], [500], + [Define to 500 only on HP-UX.]) + ;; + esac + AH_VERBATIM([__EXTENSIONS__], [/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE @@ -61,9 +73,9 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], [ac_cv_safe_to_define___extensions__], [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([ + [AC_LANG_PROGRAM([[ # define __EXTENSIONS__ 1 - AC_INCLUDES_DEFAULT])], + ]AC_INCLUDES_DEFAULT])], [ac_cv_safe_to_define___extensions__=yes], [ac_cv_safe_to_define___extensions__=no])]) test $ac_cv_safe_to_define___extensions__ = yes && @@ -78,5 +90,15 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. -AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], - [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])]) +AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], +[ + dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. + dnl gnulib does not need it. But if it gets required by third-party macros + dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a + dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". + dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, + dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +]) diff --git a/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4 new file mode 100644 index 0000000..1ae0b15 --- /dev/null +++ b/gl/m4/fcntl_h.m4 @@ -0,0 +1,96 @@ +# Configure fcntl.h. +dnl Copyright (C) 2006, 2007, 2009 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_FCNTL_H], +[ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + dnl Persuade glibc to define O_NOATIME and O_NOFOLLOW. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + #include + #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 status = !constants; + { + static char const sym[] = "conftest.sym"; + if (symlink (".", sym) != 0 + || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) + status |= 32; + } + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + char c; + struct stat st0, st1; + if (fd < 0 + || fstat (fd, &st0) != 0 + || sleep (1) != 0 + || read (fd, &c, 1) != 1 + || close (fd) != 0 + || stat (file, &st1) != 0 + || st0.st_atime != st1.st_atime) + status |= 64; + } + return status;]])], + [gl_cv_header_working_fcntl_h=yes], + [case $? in #( + 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac], + [gl_cv_header_working_fcntl_h=cross-compiling])]) + + 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.]) + + gl_CHECK_NEXT_HEADERS([fcntl.h]) + FCNTL_H='fcntl.h' + AC_SUBST([FCNTL_H]) +]) + +AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_FCNTL_H_DEFAULTS], +[ + GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) + dnl Assume proper GNU behavior unless another module says otherwise. + REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) +]) diff --git a/gl/m4/floorf.m4 b/gl/m4/floorf.m4 index 8cdaa94..915e566 100644 --- a/gl/m4/floorf.m4 +++ b/gl/m4/floorf.m4 @@ -1,5 +1,5 @@ -# floorf.m4 serial 3 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# floorf.m4 serial 4 +dnl Copyright (C) 2007, 2009 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. @@ -34,7 +34,7 @@ AC_DEFUN([gl_FUNC_FLOORF], # Sets FLOORF_LIBM. AC_DEFUN([gl_FUNC_FLOORF_LIBS], [ - AC_CACHE_VAL([gl_cv_func_floorf_libm], [ + gl_CACHE_VAL_SILENT([gl_cv_func_floorf_libm], [ gl_cv_func_floorf_libm=? AC_TRY_LINK([ #ifndef __NO_MATH_INLINES diff --git a/gl/m4/fsusage.m4 b/gl/m4/fsusage.m4 index 18eedbc..8b8cbf7 100644 --- a/gl/m4/fsusage.m4 +++ b/gl/m4/fsusage.m4 @@ -1,7 +1,7 @@ -#serial 23 +# serial 24 # Obtaining file system usage information. -# Copyright (C) 1997, 1998, 2000, 2001, 2003-2007 Free Software Foundation, Inc. +# Copyright (C) 1997-1998, 2000-2001, 2003-2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -11,16 +11,16 @@ 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_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 #endif]]) gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no]) if test $gl_cv_fs_space = yes; then - AC_LIBOBJ(fsusage) + AC_LIBOBJ([fsusage]) gl_PREREQ_FSUSAGE_EXTRA fi ]) @@ -38,21 +38,21 @@ AC_MSG_NOTICE([checking how to get file system space usage]) 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) +# 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 # SVR4 - AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs, + AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs], [AC_TRY_LINK([#include -#if defined __GLIBC__ && !defined __BEOS__ -Do not use statvfs on systems with GNU libc, because that function stats -all preceding entries in /proc/mounts, and that makes df hang if even +#if defined __GLIBC__ && defined __linux__ +Do not use statvfs on systems with GNU libc on Linux, because that function +stats all preceding entries in /proc/mounts, and that makes df hang if even one of the corresponding file systems is hard-mounted, but not available. -statvfs in GNU libc on BeOS operates differently: it only makes a system -call. +statvfs in GNU libc on Hurd, BeOS, Haiku operates differently: it only makes +a system call. #endif #ifdef __osf__ @@ -65,7 +65,7 @@ call. fu_cv_sys_stat_statvfs=no)]) if test $fu_cv_sys_stat_statvfs = yes; then ac_fsusage_space=yes - AC_DEFINE(STAT_STATVFS, 1, + AC_DEFINE([STAT_STATVFS], [1], [ Define if there is a function named statvfs. (SVR4)]) fi fi @@ -73,7 +73,7 @@ fi if test $ac_fsusage_space = no; then # DEC Alpha running OSF/1 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)]) - AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1, + AC_CACHE_VAL([fu_cv_sys_stat_statfs3_osf1], [AC_TRY_RUN([ #include #include @@ -88,10 +88,10 @@ if test $ac_fsusage_space = no; then fu_cv_sys_stat_statfs3_osf1=yes, fu_cv_sys_stat_statfs3_osf1=no, fu_cv_sys_stat_statfs3_osf1=no)]) - AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1) + AC_MSG_RESULT([$fu_cv_sys_stat_statfs3_osf1]) if test $fu_cv_sys_stat_statfs3_osf1 = yes; then ac_fsusage_space=yes - AC_DEFINE(STAT_STATFS3_OSF1, 1, + AC_DEFINE([STAT_STATFS3_OSF1], [1], [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)]) fi fi @@ -100,7 +100,7 @@ if test $ac_fsusage_space = no; then # AIX AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl member (AIX, 4.3BSD)]) - AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize, + AC_CACHE_VAL([fu_cv_sys_stat_statfs2_bsize], [AC_TRY_RUN([ #ifdef HAVE_SYS_PARAM_H #include @@ -121,10 +121,10 @@ member (AIX, 4.3BSD)]) fu_cv_sys_stat_statfs2_bsize=yes, fu_cv_sys_stat_statfs2_bsize=no, fu_cv_sys_stat_statfs2_bsize=no)]) - AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize) + AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize]) if test $fu_cv_sys_stat_statfs2_bsize = yes; then ac_fsusage_space=yes - AC_DEFINE(STAT_STATFS2_BSIZE, 1, + 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, AIX PS/2)]) fi @@ -133,7 +133,7 @@ fi if test $ac_fsusage_space = no; then # SVR3 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) - AC_CACHE_VAL(fu_cv_sys_stat_statfs4, + AC_CACHE_VAL([fu_cv_sys_stat_statfs4], [AC_TRY_RUN([#include #include int @@ -145,10 +145,10 @@ if test $ac_fsusage_space = no; then fu_cv_sys_stat_statfs4=yes, fu_cv_sys_stat_statfs4=no, fu_cv_sys_stat_statfs4=no)]) - AC_MSG_RESULT($fu_cv_sys_stat_statfs4) + AC_MSG_RESULT([$fu_cv_sys_stat_statfs4]) if test $fu_cv_sys_stat_statfs4 = yes; then ac_fsusage_space=yes - AC_DEFINE(STAT_STATFS4, 1, + AC_DEFINE([STAT_STATFS4], [1], [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)]) fi fi @@ -157,7 +157,7 @@ if test $ac_fsusage_space = no; then # 4.4BSD and NetBSD AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl member (4.4BSD and NetBSD)]) - AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize, + AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize], [AC_TRY_RUN([#include #ifdef HAVE_SYS_PARAM_H #include @@ -175,10 +175,10 @@ member (4.4BSD and NetBSD)]) fu_cv_sys_stat_statfs2_fsize=yes, fu_cv_sys_stat_statfs2_fsize=no, fu_cv_sys_stat_statfs2_fsize=no)]) - AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize) + AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize]) if test $fu_cv_sys_stat_statfs2_fsize = yes; then ac_fsusage_space=yes - AC_DEFINE(STAT_STATFS2_FSIZE, 1, + 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 @@ -187,7 +187,7 @@ fi if test $ac_fsusage_space = no; then # Ultrix AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) - AC_CACHE_VAL(fu_cv_sys_stat_fs_data, + AC_CACHE_VAL([fu_cv_sys_stat_fs_data], [AC_TRY_RUN([#include #ifdef HAVE_SYS_PARAM_H #include @@ -209,10 +209,10 @@ if test $ac_fsusage_space = no; then fu_cv_sys_stat_fs_data=yes, fu_cv_sys_stat_fs_data=no, fu_cv_sys_stat_fs_data=no)]) - AC_MSG_RESULT($fu_cv_sys_stat_fs_data) + AC_MSG_RESULT([$fu_cv_sys_stat_fs_data]) if test $fu_cv_sys_stat_fs_data = yes; then ac_fsusage_space=yes - AC_DEFINE(STAT_STATFS2_FS_DATA, 1, + AC_DEFINE([STAT_STATFS2_FS_DATA], [1], [ Define if statfs takes 2 args and the second argument has type struct fs_data. (Ultrix)]) fi @@ -222,7 +222,7 @@ if test $ac_fsusage_space = no; then # SVR2 AC_TRY_CPP([#include ], - AC_DEFINE(STAT_READ_FILSYS, 1, + AC_DEFINE([STAT_READ_FILSYS], [1], [Define if there is no specific function for reading file systems usage information and you have the header file. (SVR2)]) ac_fsusage_space=yes) @@ -239,7 +239,7 @@ AS_IF([test $ac_fsusage_space = yes], [$1], [$2]) AC_DEFUN([gl_STATFS_TRUNCATES], [ AC_MSG_CHECKING([for statfs that truncates block counts]) - AC_CACHE_VAL(fu_cv_sys_truncating_statfs, + AC_CACHE_VAL([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 @@ -251,19 +251,19 @@ choke -- this is a workaround for a Sun-specific problem [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, + 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 - AC_MSG_RESULT($fu_cv_sys_truncating_statfs) + AC_MSG_RESULT([$fu_cv_sys_truncating_statfs]) ]) # Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE. AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA], [ - AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h) + AC_CHECK_HEADERS([dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h]) gl_STATFS_TRUNCATES ]) diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4 index 5d36c19..4088671 100644 --- a/gl/m4/getaddrinfo.m4 +++ b/gl/m4/getaddrinfo.m4 @@ -1,5 +1,5 @@ -# getaddrinfo.m4 serial 15 -dnl Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# getaddrinfo.m4 serial 20 +dnl Copyright (C) 2004-2009 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. @@ -7,11 +7,23 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_GETADDRINFO], [ AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H + AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo]) + GETADDRINFO_LIB= + gai_saved_LIBS="$LIBS" - AC_CHECK_HEADERS_ONCE(netdb.h) + 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" - AC_SEARCH_LIBS(getaddrinfo, [nsl socket]) AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [ AC_TRY_LINK([ #include @@ -26,7 +38,7 @@ AC_DEFUN([gl_GETADDRINFO], [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, + AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32], gl_cv_w32_getaddrinfo, [ gl_cv_w32_getaddrinfo=no am_save_LIBS="$LIBS" @@ -37,11 +49,13 @@ AC_DEFUN([gl_GETADDRINFO], #endif #include ], [getaddrinfo(NULL, NULL, NULL, NULL);], gl_cv_w32_getaddrinfo=yes) - LIBS="$am_save_LIBS"]) + LIBS="$am_save_LIBS" + ]) if test "$gl_cv_w32_getaddrinfo" = "yes"; then - LIBS="$LIBS -lws2_32" + GETADDRINFO_LIB="-lws2_32" + LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" else - AC_LIBOBJ(getaddrinfo) + AC_LIBOBJ([getaddrinfo]) fi fi @@ -66,40 +80,34 @@ AC_DEFUN([gl_GETADDRINFO], [gl_cv_func_gai_strerror=yes], [gl_cv_func_gai_strerror=no])]) if test $gl_cv_func_gai_strerror = no; then - AC_LIBOBJ(gai_strerror) + AC_LIBOBJ([gai_strerror]) fi + LIBS="$gai_saved_LIBS" + gl_PREREQ_GETADDRINFO + + AC_SUBST([GETADDRINFO_LIB]) ]) -# Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c. +# Prerequisites of lib/netdb.in.h and lib/getaddrinfo.c. AC_DEFUN([gl_PREREQ_GETADDRINFO], [ + AC_REQUIRE([gl_NETDB_H_DEFAULTS]) AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H - AC_SEARCH_LIBS(gethostbyname, [inet nsl]) - AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet]) - AC_CHECK_FUNCS(gethostbyname,, [ - AC_CACHE_CHECK(for gethostbyname in winsock2.h and -lws2_32, - gl_cv_w32_gethostbyname, [ - gl_cv_w32_gethostbyname=no - am_save_LIBS="$LIBS" - LIBS="$LIBS -lws2_32" - AC_TRY_LINK([ -#ifdef HAVE_WINSOCK2_H -#include -#endif -#include -], [gethostbyname(NULL);], gl_cv_w32_gethostbyname=yes) - LIBS="$am_save_LIBS"]) - if test "$gl_cv_w32_gethostbyname" = "yes"; then - LIBS="$LIBS -lws2_32" - fi - ]) + AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB + AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_SOCKET_FAMILIES]) AC_REQUIRE([gl_HEADER_SYS_SOCKET]) AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h) + + 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 ]) + + AC_CHECK_HEADERS_ONCE([netinet/in.h]) + AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and @@ -115,6 +123,19 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ #include #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 #ifdef HAVE_SYS_SOCKET_H @@ -127,4 +148,19 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ #include #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 ]) diff --git a/gl/m4/gethostname.m4 b/gl/m4/gethostname.m4 index 1e9749d..6b6fca9 100644 --- a/gl/m4/gethostname.m4 +++ b/gl/m4/gethostname.m4 @@ -1,18 +1,21 @@ -# gethostname.m4 serial 2 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# gethostname.m4 serial 5 +dnl Copyright (C) 2002, 2008, 2009 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_GETHOSTNAME], [ - AC_REPLACE_FUNCS(gethostname) + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + gl_PREREQ_SYS_H_WINSOCK2 + AC_REPLACE_FUNCS([gethostname]) if test $ac_cv_func_gethostname = no; then + HAVE_GETHOSTNAME=0 gl_PREREQ_GETHOSTNAME fi ]) # Prerequisites of lib/gethostname.c. AC_DEFUN([gl_PREREQ_GETHOSTNAME], [ - AC_CHECK_FUNCS(uname) + AC_CHECK_FUNCS([uname]) ]) diff --git a/gl/m4/getloadavg.m4 b/gl/m4/getloadavg.m4 index c1547c7..015bcac 100644 --- a/gl/m4/getloadavg.m4 +++ b/gl/m4/getloadavg.m4 @@ -1,7 +1,7 @@ # Check for getloadavg. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, -# 2006 Free Software Foundation, Inc. +# 2006, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -13,7 +13,12 @@ # gl_GETLOADAVG(LIBOBJDIR) # ------------------------ AC_DEFUN([gl_GETLOADAVG], -[gl_have_func=no # yes means we've found a way to get the load average. +[AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + +# Persuade glibc to declare getloadavg(). +AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + +gl_have_func=no # yes means we've found a way to get the load average. # Make sure getloadavg.c is where it belongs, at configure-time. test -f "$srcdir/$1/getloadavg.c" || @@ -22,17 +27,17 @@ test -f "$srcdir/$1/getloadavg.c" || gl_save_LIBS=$LIBS # Check for getloadavg, but be sure not to touch the cache variable. -(AC_CHECK_FUNC(getloadavg, exit 0, exit 1)) && gl_have_func=yes +(AC_CHECK_FUNC([getloadavg], [exit 0], [exit 1])) && gl_have_func=yes # On HPUX9, an unprivileged user can get load averages through this function. -AC_CHECK_FUNCS(pstat_getdynamic) +AC_CHECK_FUNCS([pstat_getdynamic]) # Solaris has libkstat which does not require root. -AC_CHECK_LIB(kstat, kstat_open) +AC_CHECK_LIB([kstat], [kstat_open]) test $ac_cv_lib_kstat_kstat_open = yes && gl_have_func=yes # AIX has libperfstat which does not require root -AC_CHECK_LIB(perfstat, perfstat_cpu_total) +AC_CHECK_LIB([perfstat], [perfstat_cpu_total]) test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_have_func=yes # Some systems with -lutil have (and need) -lkvm as well, some do not. @@ -40,12 +45,12 @@ test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_have_func=yes # to get the right answer into the cache. # For kstat on solaris, we need libelf to force the definition of SVR4 below. if test $gl_have_func = no; then - AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS") + AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"]) fi if test $gl_have_func = no; then - AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS") + AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"]) # Check for the 4.4BSD definition of getloadavg. - AC_CHECK_LIB(util, getloadavg, + AC_CHECK_LIB([util], [getloadavg], [LIBS="-lutil $LIBS" gl_have_func=yes gl_cv_func_getloadavg_setgid=yes]) fi @@ -54,17 +59,17 @@ if test $gl_have_func = no; then # Since it is not a standard part of AIX, it might be installed locally. gl_getloadavg_LIBS=$LIBS LIBS="-L/usr/local/lib $LIBS" - AC_CHECK_LIB(getloadavg, getloadavg, + AC_CHECK_LIB([getloadavg], [getloadavg], [LIBS="-lgetloadavg $LIBS"], [LIBS=$gl_getloadavg_LIBS]) fi # Make sure it is really in the library, if we think we found it, # otherwise set up the replacement function. -AC_CHECK_FUNCS(getloadavg, [], +AC_CHECK_FUNCS([getloadavg], [], [gl_PREREQ_GETLOADAVG]) # Some definitions of getloadavg require that the program be installed setgid. -AC_CACHE_CHECK(whether getloadavg requires setgid, +AC_CACHE_CHECK([whether getloadavg requires setgid], gl_cv_func_getloadavg_setgid, [AC_EGREP_CPP([Yowza Am I SETGID yet], [#define CONFIGURING_GETLOADAVG @@ -77,16 +82,16 @@ Yowza Am I SETGID yet gl_cv_func_getloadavg_setgid=no)]) if test $gl_cv_func_getloadavg_setgid = yes; then NEED_SETGID=true - AC_DEFINE(GETLOADAVG_PRIVILEGED, 1, + AC_DEFINE([GETLOADAVG_PRIVILEGED], [1], [Define to 1 if the `getloadavg' function needs to be run setuid or setgid.]) else NEED_SETGID=false fi -AC_SUBST(NEED_SETGID)dnl +AC_SUBST([NEED_SETGID])dnl if test $gl_cv_func_getloadavg_setgid = yes; then - AC_CACHE_CHECK(group of /dev/kmem, gl_cv_group_kmem, + AC_CACHE_CHECK([group of /dev/kmem], [gl_cv_group_kmem], [ # On Solaris, /dev/kmem is a symlink. Get info on the real file. ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null` # If we got an error (system does not support symlinks), try without -L. @@ -96,7 +101,7 @@ if test $gl_cv_func_getloadavg_setgid = yes; then s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/ / /s/.* //;p']` ]) - AC_SUBST(KMEM_GROUP, $gl_cv_group_kmem)dnl + AC_SUBST([KMEM_GROUP], [$gl_cv_group_kmem])dnl fi if test "x$gl_save_LIBS" = x; then GETLOADAVG_LIBS=$LIBS @@ -105,7 +110,21 @@ else fi LIBS=$gl_save_LIBS -AC_SUBST(GETLOADAVG_LIBS)dnl +AC_SUBST([GETLOADAVG_LIBS])dnl + +# Test whether the system declares getloadavg. Solaris has the function +# but declares it in , not . +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 + # include + #endif + #include ]) ])# gl_GETLOADAVG @@ -113,44 +132,44 @@ AC_SUBST(GETLOADAVG_LIBS)dnl # -------------------- # Set up the AC_LIBOBJ replacement of `getloadavg'. AC_DEFUN([gl_PREREQ_GETLOADAVG], -[AC_LIBOBJ(getloadavg) -AC_DEFINE(C_GETLOADAVG, 1, [Define to 1 if using `getloadavg.c'.]) +[AC_LIBOBJ([getloadavg]) +AC_DEFINE([C_GETLOADAVG], [1], [Define to 1 if using `getloadavg.c'.]) # Figure out what our getloadavg.c needs. gl_have_func=no -AC_CHECK_HEADER(sys/dg_sys_info.h, +AC_CHECK_HEADER([sys/dg_sys_info.h], [gl_have_func=yes - AC_DEFINE(DGUX, 1, [Define to 1 for DGUX with .]) - AC_CHECK_LIB(dgc, dg_sys_info)]) + AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with .]) + AC_CHECK_LIB([dgc], [dg_sys_info])]) # We cannot check for , because Solaris 2 does not use dwarf (it # uses stabs), but it is still SVR4. We cannot check for because # Irix 4.0.5F has the header but not the library. if test $gl_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then gl_have_func=yes - AC_DEFINE(SVR4, 1, [Define to 1 on System V Release 4.]) + AC_DEFINE([SVR4], [1], [Define to 1 on System V Release 4.]) fi if test $gl_have_func = no; then - AC_CHECK_HEADER(inq_stats/cpustats.h, + AC_CHECK_HEADER([inq_stats/cpustats.h], [gl_have_func=yes - AC_DEFINE(UMAX, 1, [Define to 1 for Encore UMAX.]) - AC_DEFINE(UMAX4_3, 1, + 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 instead of .])]) fi if test $gl_have_func = no; then - AC_CHECK_HEADER(sys/cpustats.h, - [gl_have_func=yes; AC_DEFINE(UMAX)]) + AC_CHECK_HEADER([sys/cpustats.h], + [gl_have_func=yes; AC_DEFINE([UMAX])]) fi if test $gl_have_func = no; then - AC_CHECK_HEADERS(mach/mach.h) + AC_CHECK_HEADERS([mach/mach.h]) fi -AC_CHECK_HEADERS(nlist.h, +AC_CHECK_HEADERS([nlist.h], [AC_CHECK_MEMBERS([struct nlist.n_un.n_name], - [AC_DEFINE(NLIST_NAME_UNION, 1, + [AC_DEFINE([NLIST_NAME_UNION], [1], [Define to 1 if your `struct nlist' has an `n_un' member. Obsolete, depend on `HAVE_STRUCT_NLIST_N_UN_N_NAME])], [], diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4 index c0a73b2..9b683c2 100644 --- a/gl/m4/getopt.m4 +++ b/gl/m4/getopt.m4 @@ -1,5 +1,5 @@ -# getopt.m4 serial 13 -dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# getopt.m4 serial 14 +dnl Copyright (C) 2002-2006, 2008 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. @@ -46,7 +46,7 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS], if test -z "$GETOPT_H"; then AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], [AC_RUN_IFELSE( - [AC_LANG_PROGRAM([#include ], + [AC_LANG_PROGRAM([[#include ]], [[ char *myargv[3]; myargv[0] = "conftest"; diff --git a/gl/m4/gettext.m4 b/gl/m4/gettext.m4 index c9ae1f7..d90c850 100644 --- a/gl/m4/gettext.m4 +++ b/gl/m4/gettext.m4 @@ -1,5 +1,5 @@ -# gettext.m4 serial 60 (gettext-0.17) -dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. +# gettext.m4 serial 62 (gettext-0.18) +dnl Copyright (C) 1995-2009 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. @@ -123,11 +123,11 @@ AC_DEFUN([AM_GNU_GETTEXT], gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) - AC_ARG_WITH(included-gettext, + 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) + 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 @@ -267,7 +267,7 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then - AC_DEFINE(ENABLE_NLS, 1, + AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else @@ -301,9 +301,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a fi dnl For backward compatibility. Some packages may be using this. - AC_DEFINE(HAVE_GETTEXT, 1, + AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) - AC_DEFINE(HAVE_DCGETTEXT, 1, + AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi @@ -319,9 +319,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a fi dnl Make all variables we use known to autoconf. - AC_SUBST(BUILD_INCLUDED_LIBINTL) - AC_SUBST(USE_INCLUDED_LIBINTL) - AC_SUBST(CATOBJEXT) + AC_SUBST([BUILD_INCLUDED_LIBINTL]) + AC_SUBST([USE_INCLUDED_LIBINTL]) + AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= @@ -329,36 +329,36 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share - AC_SUBST(DATADIRNAME) + AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo - AC_SUBST(INSTOBJEXT) + AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat - AC_SUBST(GENCAT) + AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi - AC_SUBST(INTLOBJS) + AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix - AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" - AC_SUBST(INTLLIBS) + AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. - AC_SUBST(LIBINTL) - AC_SUBST(LTLIBINTL) - AC_SUBST(POSUB) + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + AC_SUBST([POSUB]) ]) diff --git a/gl/m4/glibc21.m4 b/gl/m4/glibc21.m4 index d95fd98..93fbf47 100644 --- a/gl/m4/glibc21.m4 +++ b/gl/m4/glibc21.m4 @@ -1,5 +1,5 @@ -# glibc21.m4 serial 3 -dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. +# glibc21.m4 serial 4 +dnl Copyright (C) 2000-2002, 2004, 2008 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. @@ -9,8 +9,8 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_GLIBC21], [ - AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, - ac_cv_gnu_library_2_1, + AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer], + [ac_cv_gnu_library_2_1], [AC_EGREP_CPP([Lucky GNU user], [ #include @@ -20,11 +20,11 @@ AC_DEFUN([gl_GLIBC21], #endif #endif ], - ac_cv_gnu_library_2_1=yes, - ac_cv_gnu_library_2_1=no) + [ac_cv_gnu_library_2_1=yes], + [ac_cv_gnu_library_2_1=no]) ] ) - AC_SUBST(GLIBC21) + AC_SUBST([GLIBC21]) GLIBC21="$ac_cv_gnu_library_2_1" ] ) diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 new file mode 100644 index 0000000..385f543 --- /dev/null +++ b/gl/m4/gnulib-cache.m4 @@ -0,0 +1,47 @@ +# Copyright (C) 2002-2009 Free Software Foundation, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. 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 using CVS, this file is meant to be stored in CVS, +# like the configure.ac and various Makefile.am files. + + +# Specification in the form of a command-line invocation: +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex timegm vasprintf vsnprintf + +# Specification in the form of a few gnulib-tool.m4 macro invocations: +gl_LOCAL_DIR([]) +gl_MODULES([ + base64 + dirname + floorf + fsusage + getaddrinfo + gethostname + getloadavg + getopt + gettext + mountlist + regex + timegm + 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([]) diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4 index 9336d72..c8fda20 100644 --- a/gl/m4/gnulib-common.m4 +++ b/gl/m4/gnulib-common.m4 @@ -1,9 +1,39 @@ -# gnulib-common.m4 serial 3 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# gnulib-common.m4 serial 11 +dnl Copyright (C) 2007-2009 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_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_DEFUN([gl_COMMON_BODY], [ + 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 MacOS 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([unused_parameter], +[/* Define as a marker that can be attached to function parameter declarations + for parameters that are not used. This helps to reduce warnings, such as + from GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) +#else +# define _UNUSED_PARAMETER_ +#endif +]) +]) + # gl_MODULE_INDICATOR([modulename]) # defines a C macro indicating the presence of the given module. AC_DEFUN([gl_MODULE_INDICATOR], @@ -12,11 +42,18 @@ AC_DEFUN([gl_MODULE_INDICATOR], [Define to 1 when using the gnulib module ]$1[.]) ]) +# m4_foreach_w +# is a backport of autoconf-2.59c's m4_foreach_w. +# Remove this macro when we can assume autoconf >= 2.60. +m4_ifndef([m4_foreach_w], + [m4_define([m4_foreach_w], + [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) + # AC_PROG_MKDIR_P # is a backport of autoconf-2.60's AC_PROG_MKDIR_P. # Remove this macro when we can assume autoconf >= 2.60. m4_ifdef([AC_PROG_MKDIR_P], [], [ - AC_DEFUN([AC_PROG_MKDIR_P], + AC_DEFUN_ONCE([AC_PROG_MKDIR_P], [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake MKDIR_P='$(mkdir_p)' AC_SUBST([MKDIR_P])])]) @@ -27,7 +64,7 @@ m4_ifdef([AC_PROG_MKDIR_P], [], [ # works. # This definition can be removed once autoconf >= 2.62 can be assumed. AC_DEFUN([AC_C_RESTRICT], -[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, +[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do @@ -63,3 +100,25 @@ AC_DEFUN([AC_C_RESTRICT], *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ]) + +# 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 +]) + +# 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], +[ + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + AC_CACHE_VAL([$1], [$2]) + as_echo_n="$saved_as_echo_n" +]) diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index 85ad2e9..005cc4e 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2004-2007 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -25,7 +25,6 @@ AC_DEFUN([gl_EARLY], m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable AC_REQUIRE([AC_PROG_RANLIB]) - AC_REQUIRE([AC_GNU_SOURCE]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) ]) @@ -40,20 +39,27 @@ AC_DEFUN([gl_INIT], 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], []) + gl_COMMON gl_source_base='gl' gl_FUNC_ALLOCA gl_HEADER_ARPA_INET AC_PROG_MKDIR_P gl_FUNC_BASE64 + gl_FUNC_BTOWC + gl_WCHAR_MODULE_INDICATOR([btowc]) gl_C_STRTOD gl_CLOEXEC gl_DIRNAME gl_DOUBLE_SLASH_ROOT + gl_HEADER_ERRNO_H gl_ERROR m4_ifdef([AM_XGETTEXT_OPTION], [AM_XGETTEXT_OPTION([--flag=error:3:c-format]) AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) gl_EXITFAIL + gl_FCNTL_H gl_FCNTL_SAFER gl_MODULE_INDICATOR([fcntl-safer]) gl_FLOAT_H @@ -61,14 +67,19 @@ AC_DEFUN([gl_INIT], gl_MATH_MODULE_INDICATOR([floorf]) gl_FSUSAGE gl_GETADDRINFO + gl_NETDB_MODULE_INDICATOR([getaddrinfo]) gl_FUNC_GETHOSTNAME + gl_UNISTD_MODULE_INDICATOR([gethostname]) gl_GETLOADAVG([$gl_source_base]) + gl_STDLIB_MODULE_INDICATOR([getloadavg]) gl_GETOPT dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. AM_GNU_GETTEXT_VERSION([0.17]) AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) + gl_HOSTENT gl_INET_NTOP + gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) gl_INLINE gl_LOCALCHARSET LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\"" @@ -78,12 +89,23 @@ AC_DEFUN([gl_INIT], gl_FUNC_MALLOC_POSIX gl_STDLIB_MODULE_INDICATOR([malloc-posix]) gl_MATH_H + gl_FUNC_MBRTOWC + gl_WCHAR_MODULE_INDICATOR([mbrtowc]) + gl_FUNC_MBSINIT + gl_WCHAR_MODULE_INDICATOR([mbsinit]) + gl_FUNC_MKTIME gl_MOUNTLIST + gl_MULTIARCH + gl_HEADER_NETDB gl_HEADER_NETINET_IN AC_PROG_MKDIR_P + gl_FUNC_OPEN + gl_MODULE_INDICATOR([open]) + gl_FCNTL_MODULE_INDICATOR([open]) gl_REGEX gl_SAFE_READ gl_SAFE_WRITE + gl_SERVENT gl_SIZE_MAX gl_FUNC_SNPRINTF gl_STDIO_MODULE_INDICATOR([snprintf]) @@ -93,7 +115,7 @@ AC_DEFUN([gl_INIT], gl_STDINT_H gl_STDIO_H gl_STDLIB_H - gl_FUNC_STRDUP + gl_FUNC_STRDUP_POSIX gl_STRING_MODULE_INDICATOR([strdup]) gl_FUNC_STRERROR gl_STRING_MODULE_INDICATOR([strerror]) @@ -104,6 +126,9 @@ AC_DEFUN([gl_INIT], gl_STRING_MODULE_INDICATOR([strnlen]) gl_HEADER_SYS_SOCKET AC_PROG_MKDIR_P + gl_HEADER_TIME_H + gl_TIME_R + gl_FUNC_TIMEGM gl_UNISTD_H gl_UNISTD_SAFER gl_FUNC_VASNPRINTF @@ -115,10 +140,27 @@ AC_DEFUN([gl_INIT], gl_FUNC_VSNPRINTF gl_STDIO_MODULE_INDICATOR([vsnprintf]) gl_WCHAR_H + gl_FUNC_WCRTOMB + gl_WCHAR_MODULE_INDICATOR([wcrtomb]) gl_WCTYPE_H + gl_FUNC_WRITE + gl_UNISTD_MODULE_INDICATOR([write]) gl_XALLOC gl_XSIZE gl_XSTRNDUP + 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_LIBSOURCES_DIR]) + m4_popdef([gl_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) @@ -141,7 +183,23 @@ AC_DEFUN([gl_INIT], 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], []) + gl_COMMON gl_source_base='tests' + 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([gltests_LIBSOURCES_DIR]) + m4_popdef([gltests_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) @@ -172,13 +230,6 @@ AC_DEFUN([gl_LIBOBJ], [ gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext" ]) -# m4_foreach_w is provided by autoconf-2.59c and later. -# This definition is to accommodate developers using versions -# of autoconf older than that. -m4_ifndef([m4_foreach_w], - [m4_define([m4_foreach_w], - [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) - # Like AC_REPLACE_FUNCS, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_REPLACE_FUNCS], [ @@ -187,15 +238,14 @@ AC_DEFUN([gl_REPLACE_FUNCS], [ ]) # Like AC_LIBSOURCES, except the directory where the source file is -# expected is derived from the gnulib-tool parametrization, +# 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_syscmd([test -r gl/]_gl_NAME[ || test ! -d gl])dnl - m4_if(m4_sysval, [0], [], - [AC_FATAL([missing gl/]_gl_NAME)]) + m4_define([gl_LIBSOURCES_DIR], [gl]) + m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ]) ]) ]) ]) @@ -207,13 +257,6 @@ AC_DEFUN([gltests_LIBOBJ], [ gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext" ]) -# m4_foreach_w is provided by autoconf-2.59c and later. -# This definition is to accommodate developers using versions -# of autoconf older than that. -m4_ifndef([m4_foreach_w], - [m4_define([m4_foreach_w], - [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) - # Like AC_REPLACE_FUNCS, except that the module name goes # into gltests_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gltests_REPLACE_FUNCS], [ @@ -222,15 +265,14 @@ AC_DEFUN([gltests_REPLACE_FUNCS], [ ]) # Like AC_LIBSOURCES, except the directory where the source file is -# expected is derived from the gnulib-tool parametrization, +# 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_syscmd([test -r tests/]_gl_NAME[ || test ! -d tests])dnl - m4_if(m4_sysval, [0], [], - [AC_FATAL([missing tests/]_gl_NAME)]) + m4_define([gltests_LIBSOURCES_DIR], [tests]) + m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ]) ]) ]) ]) @@ -240,13 +282,16 @@ AC_DEFUN([gltests_LIBSOURCES], [ AC_DEFUN([gl_FILE_LIST], [ build-aux/config.rpath build-aux/link-warning.h + lib/alignof.h lib/alloca.c lib/alloca.in.h + lib/arpa_inet.in.h lib/asnprintf.c lib/asprintf.c lib/base64.c lib/base64.h lib/basename.c + lib/btowc.c lib/c-strtod.c lib/c-strtod.h lib/cloexec.c @@ -256,12 +301,14 @@ AC_DEFUN([gl_FILE_LIST], [ lib/dirname.c lib/dirname.h lib/dup-safer.c + lib/errno.in.h lib/error.c lib/error.h lib/exitfail.c lib/exitfail.h lib/fcntl--.h lib/fcntl-safer.h + lib/fcntl.in.h lib/fd-safer.c lib/float+.h lib/float.in.h @@ -275,7 +322,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/full-write.h lib/gai_strerror.c lib/getaddrinfo.c - lib/getaddrinfo.h lib/gethostname.c lib/getloadavg.c lib/getopt.c @@ -284,16 +330,20 @@ AC_DEFUN([gl_FILE_LIST], [ lib/getopt_int.h lib/gettext.h lib/inet_ntop.c - lib/inet_ntop.h lib/intprops.h lib/localcharset.c lib/localcharset.h lib/malloc.c lib/math.in.h + lib/mbrtowc.c + lib/mbsinit.c + lib/mktime.c lib/mountlist.c lib/mountlist.h + lib/netdb.in.h lib/netinet_in.in.h lib/open-safer.c + lib/open.c lib/pipe-safer.c lib/printf-args.c lib/printf-args.h @@ -315,45 +365,55 @@ AC_DEFUN([gl_FILE_LIST], [ lib/snprintf.c lib/stdbool.in.h lib/stdint.in.h + lib/stdio-write.c lib/stdio.in.h lib/stdlib.in.h lib/strdup.c + lib/streq.h lib/strerror.c lib/string.in.h lib/stripslash.c lib/strndup.c lib/strnlen.c lib/sys_socket.in.h + lib/time.in.h + lib/time_r.c + lib/timegm.c lib/unistd--.h lib/unistd-safer.h lib/unistd.in.h lib/vasnprintf.c lib/vasnprintf.h lib/vasprintf.c + lib/verify.h lib/vsnprintf.c lib/wchar.in.h + lib/wcrtomb.c lib/wctype.in.h + lib/write.c lib/xalloc-die.c lib/xalloc.h lib/xmalloc.c lib/xsize.h lib/xstrndup.c lib/xstrndup.h - m4/absolute-header.m4 + m4/00gnulib.m4 m4/alloca.m4 m4/arpa_inet_h.m4 m4/base64.m4 + m4/btowc.m4 m4/c-strtod.m4 m4/cloexec.m4 m4/codeset.m4 m4/dirname.m4 m4/dos.m4 m4/double-slash-root.m4 - m4/eoverflow.m4 + m4/errno_h.m4 m4/error.m4 m4/exitfail.m4 m4/extensions.m4 m4/fcntl-safer.m4 + m4/fcntl_h.m4 m4/float_h.m4 m4/floorf.m4 m4/fstypename.m4 @@ -366,6 +426,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/glibc2.m4 m4/glibc21.m4 m4/gnulib-common.m4 + m4/hostent.m4 m4/iconv.m4 m4/include_next.m4 m4/inet_ntop.m4 @@ -383,21 +444,33 @@ AC_DEFUN([gl_FILE_LIST], [ m4/lib-link.m4 m4/lib-prefix.m4 m4/localcharset.m4 + m4/locale-fr.m4 + m4/locale-ja.m4 + m4/locale-zh.m4 m4/lock.m4 m4/longlong.m4 m4/ls-mntd-fs.m4 m4/malloc.m4 m4/math_h.m4 + m4/mbrtowc.m4 + m4/mbsinit.m4 + m4/mbstate_t.m4 + m4/mktime.m4 m4/mountlist.m4 + m4/multiarch.m4 + m4/netdb_h.m4 m4/netinet_in_h.m4 m4/nls.m4 - m4/onceonly_2_57.m4 + m4/onceonly.m4 + m4/open.m4 m4/po.m4 m4/printf-posix.m4 + m4/printf.m4 m4/progtest.m4 m4/regex.m4 m4/safe-read.m4 m4/safe-write.m4 + m4/servent.m4 m4/size_max.m4 m4/snprintf.m4 m4/socklen.m4 @@ -414,6 +487,10 @@ AC_DEFUN([gl_FILE_LIST], [ m4/strndup.m4 m4/strnlen.m4 m4/sys_socket_h.m4 + m4/threadlib.m4 + m4/time_h.m4 + m4/time_r.m4 + m4/timegm.m4 m4/uintmax_t.m4 m4/unistd-safer.m4 m4/unistd_h.m4 @@ -423,8 +500,10 @@ AC_DEFUN([gl_FILE_LIST], [ m4/vsnprintf.m4 m4/wchar.m4 m4/wchar_t.m4 + m4/wcrtomb.m4 m4/wctype.m4 m4/wint_t.m4 + m4/write.m4 m4/xalloc.m4 m4/xsize.m4 m4/xstrndup.m4 diff --git a/gl/m4/hostent.m4 b/gl/m4/hostent.m4 new file mode 100644 index 0000000..4a96af7 --- /dev/null +++ b/gl/m4/hostent.m4 @@ -0,0 +1,45 @@ +# hostent.m4 serial 1 +dnl Copyright (C) 2008 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, 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_HEADER_SYS_SOCKET])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_TRY_LINK([ +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include +], [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/iconv.m4 b/gl/m4/iconv.m4 index 66bc76f..3cc6268 100644 --- a/gl/m4/iconv.m4 +++ b/gl/m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial AM6 (gettext-0.17) -dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. +# iconv.m4 serial AM7 (gettext-0.18) +dnl Copyright (C) 2000-2002, 2007-2009 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. @@ -34,7 +34,7 @@ AC_DEFUN([AM_ICONV_LINK], am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) - AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ + AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include @@ -42,7 +42,7 @@ AC_DEFUN([AM_ICONV_LINK], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], - am_cv_func_iconv=yes) + [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" @@ -51,13 +51,13 @@ AC_DEFUN([AM_ICONV_LINK], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) + [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, [ + AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then @@ -134,7 +134,7 @@ int main () am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, + AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then @@ -147,8 +147,8 @@ int main () LIBICONV= LTLIBICONV= fi - AC_SUBST(LIBICONV) - AC_SUBST(LTLIBICONV) + AC_SUBST([LIBICONV]) + AC_SUBST([LTLIBICONV]) ]) AC_DEFUN([AM_ICONV], @@ -156,7 +156,7 @@ 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_CACHE_VAL([am_cv_proto_iconv], [ AC_TRY_COMPILE([ #include #include @@ -169,12 +169,12 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si #else size_t iconv(); #endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") +], [], [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([$]{ac_t:- - }[$]am_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + AC_MSG_RESULT([${ac_t:- + }$am_cv_proto_iconv]) + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) fi ]) diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4 index 7ce472b..d6101fe 100644 --- a/gl/m4/include_next.m4 +++ b/gl/m4/include_next.m4 @@ -1,19 +1,47 @@ -# include_next.m4 serial 4 -dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc. +# include_next.m4 serial 12 +dnl Copyright (C) 2006-2009 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 and PRAGMA_SYSTEM_HEADER. +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__'. + 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 conftestd1 conftestd2 - mkdir conftestd1 conftestd2 - cat < conftestd1/conftest.h + [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 . + 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 . By virtue of the second bug, we need to use + dnl include_next as well in this case. + cat < conftestd1a/conftest.h #define DEFINED_IN_CONFTESTD1 #include_next #ifdef DEFINED_IN_CONFTESTD2 @@ -21,6 +49,16 @@ int foo; #else #error "include_next doesn't work" #endif +EOF + cat < conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif EOF cat < conftestd2/conftest.h #ifndef DEFINED_IN_CONFTESTD1 @@ -28,26 +66,37 @@ EOF #endif #define DEFINED_IN_CONFTESTD2 EOF - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" AC_COMPILE_IFELSE([#include ], [gl_cv_have_include_next=yes], - [gl_cv_have_include_next=no]) - CPPFLAGS="$save_CPPFLAGS" - rm -rf conftestd1 conftestd2 + [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + AC_COMPILE_IFELSE([#include ], + [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 - - dnl FIXME: Remove HAVE_INCLUDE_NEXT and update everything that uses it - dnl to use @INCLUDE_NEXT@ instead. - AC_DEFINE([HAVE_INCLUDE_NEXT], 1, - [Define if your compiler supports the #include_next directive.]) - 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 - INCLUDE_NEXT=include + 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]) ]) # gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...) @@ -63,12 +112,16 @@ EOF # 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_CHECK_NEXT_HEADERS], [ AC_REQUIRE([gl_INCLUDE_NEXT]) + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_HEADERS_ONCE([$1]) - AC_FOREACH([gl_HEADER_NAME], [$1], + m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_next_header], [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME]))) if test $gl_cv_have_include_next = yes; then @@ -84,11 +137,22 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS], [AC_LANG_SOURCE( [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]] )]) - dnl eval is necessary to expand ac_cpp. + 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 , , + 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 + 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_next_header], - ['"'`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{ s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1# s#^/[^/]#//&# diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4 index bb02d22..2bbdca1 100644 --- a/gl/m4/inet_ntop.m4 +++ b/gl/m4/inet_ntop.m4 @@ -1,19 +1,37 @@ -# inet_ntop.m4 serial 3 -dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. +# inet_ntop.m4 serial 9 +dnl Copyright (C) 2005, 2006, 2008, 2009 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_INET_NTOP], [ - AC_REPLACE_FUNCS(inet_ntop) + dnl Persuade Solaris to declare inet_ntop. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + gl_REPLACE_ARPA_INET_H + + dnl The AC_SEARCH_LIBS call is a hack to persuade the Solaris 8 linker to + dnl find inet_ntop. + dnl + dnl It is the responsibility of gl_INET_NTOP's caller to arrange for + dnl -lnsl if it is needed. Normally -lnsl is not needed on Solaris 8, + dnl since inet_ntop is needed only by getaddrinfo, and getaddrinfo + dnl isn't built on Solaris 8. + gl_save_LIBS=$LIBS + AC_SEARCH_LIBS([inet_ntop], [nsl], [], + [AC_REPLACE_FUNCS([inet_ntop])]) + LIBS=$gl_save_LIBS + gl_PREREQ_INET_NTOP ]) -# Prerequisites of lib/inet_ntop.h and lib/inet_ntop.c. +# Prerequisites of lib/inet_ntop.c. AC_DEFUN([gl_PREREQ_INET_NTOP], [ - AC_CHECK_HEADERS_ONCE([netinet/in.h arpa/inet.h]) AC_CHECK_DECLS([inet_ntop],,,[#include ]) + if test $ac_cv_have_decl_inet_ntop = no; then + HAVE_DECL_INET_NTOP=0 + fi AC_REQUIRE([gl_SOCKET_FAMILIES]) AC_REQUIRE([AC_C_RESTRICT]) ]) diff --git a/gl/m4/inline.m4 b/gl/m4/inline.m4 index a07076c..cee5109 100644 --- a/gl/m4/inline.m4 +++ b/gl/m4/inline.m4 @@ -1,5 +1,5 @@ -# inline.m4 serial 3 -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# inline.m4 serial 4 +dnl Copyright (C) 2006, 2009 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. @@ -32,7 +32,7 @@ AC_DEFUN([gl_INLINE], fi ]) if test $gl_cv_c_inline_effective = yes; then - AC_DEFINE([HAVE_INLINE], 1, + AC_DEFINE([HAVE_INLINE], [1], [Define to 1 if the compiler supports one of the keywords 'inline', '__inline__', '__inline' and effectively inlines functions marked as such.]) diff --git a/gl/m4/intlmacosx.m4 b/gl/m4/intlmacosx.m4 index d3f0d90..c24837c 100644 --- a/gl/m4/intlmacosx.m4 +++ b/gl/m4/intlmacosx.m4 @@ -1,5 +1,5 @@ -# intlmacosx.m4 serial 1 (gettext-0.17) -dnl Copyright (C) 2004-2007 Free Software Foundation, Inc. +# intlmacosx.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2004-2009 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. @@ -19,7 +19,7 @@ AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], - gt_cv_func_CFPreferencesCopyAppValue, + [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], @@ -28,11 +28,11 @@ AC_DEFUN([gt_INTL_MACOSX], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then - AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. - AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, + AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], @@ -40,7 +40,7 @@ AC_DEFUN([gt_INTL_MACOSX], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= diff --git a/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4 index 50ae35d..264cb57 100644 --- a/gl/m4/intmax_t.m4 +++ b/gl/m4/intmax_t.m4 @@ -1,12 +1,12 @@ -# intmax_t.m4 serial 6 -dnl Copyright (C) 1997-2004, 2006-2007 Free Software Foundation, Inc. +# intmax_t.m4 serial 7 +dnl Copyright (C) 1997-2004, 2006-2007, 2009 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_PREREQ(2.13) +AC_PREREQ([2.13]) # Define intmax_t to 'long' or 'long long' # if it is not already defined in or . @@ -22,10 +22,10 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T], test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if and don't define.]) else - AC_DEFINE(HAVE_INTMAX_T, 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) fi ]) @@ -36,7 +36,7 @@ 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_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], [AC_TRY_COMPILE([ #include #include @@ -48,14 +48,14 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], #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, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) else AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if and don't define.]) fi ]) diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4 index edc8ecb..f4ca160 100644 --- a/gl/m4/inttypes_h.m4 +++ b/gl/m4/inttypes_h.m4 @@ -1,5 +1,5 @@ -# inttypes_h.m4 serial 7 -dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. +# inttypes_h.m4 serial 9 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 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. @@ -11,15 +11,15 @@ dnl From Paul Eggert. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ - AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, + AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1; return !i;], - gl_cv_header_inttypes_h=yes, - gl_cv_header_inttypes_h=no)]) + [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, + AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi diff --git a/gl/m4/lib-ld.m4 b/gl/m4/lib-ld.m4 index 96c4e2c..e4863f2 100644 --- a/gl/m4/lib-ld.m4 +++ b/gl/m4/lib-ld.m4 @@ -1,5 +1,5 @@ -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +# lib-ld.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2009 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. @@ -10,7 +10,7 @@ dnl with libtool.m4. dnl From libtool-1.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, +[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 ld's only accept -v. case `$LD -v 2>&1 conftest.sh . ./conftest.sh @@ -131,11 +134,32 @@ AC_DEFUN([AC_LIB_RPATH], 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, + 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],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + define([acl_frompackage_]NAME, [$2]) + popdef([NAME]) + pushdef([PACK],[$2]) + pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + define([acl_libsinpackage_]PACKUP, + m4_ifdef([acl_libsinpackage_]PACKUP, [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. @@ -144,19 +168,23 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) + pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. - define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) 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_LIB_ARG_WITH([lib]N_A_M_E[-prefix], -[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], + AC_ARG_WITH(P_A_C_K[-prefix], +[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib + --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no @@ -169,6 +197,10 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi fi fi ]) @@ -327,7 +359,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], 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"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else @@ -415,7 +449,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIB[]NAME[]_PREFIX="$basedir" + 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" ;; esac @@ -476,9 +519,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], 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$additional_libdir" != "X/usr/$acl_libdirstem"; then + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -609,6 +654,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi + popdef([P_A_C_K]) + popdef([PACKLIBS]) + popdef([PACKUP]) + popdef([PACK]) + popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, @@ -654,7 +704,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. - if test "X$dir" != "X/usr/$acl_libdirstem"; then + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= @@ -663,7 +714,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], -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"; then + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; diff --git a/gl/m4/lib-prefix.m4 b/gl/m4/lib-prefix.m4 index a8684e1..4b7ee33 100644 --- a/gl/m4/lib-prefix.m4 +++ b/gl/m4/lib-prefix.m4 @@ -1,5 +1,5 @@ -# lib-prefix.m4 serial 5 (gettext-0.15) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. +# lib-prefix.m4 serial 7 (gettext-0.18) +dnl Copyright (C) 2001-2005, 2008-2009 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. @@ -153,33 +153,72 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], prefix="$acl_save_prefix" ]) -dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing -dnl the basename of the libdir, either "lib" or "lib64". +dnl AC_LIB_PREPARE_MULTILIB creates +dnl - a variable acl_libdirstem, containing the basename of the libdir, either +dnl "lib" or "lib64" or "lib/64", +dnl - a variable acl_libdirstem2, as a secondary possible value for +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or +dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ - dnl There is no formal standard regarding lib and lib64. The current - dnl practice is that on a system supporting 32-bit and 64-bit instruction - dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit - dnl libraries go under $prefix/lib. We determine the compiler's default - dnl mode by looking at the compiler's library search path. If at least - dnl of its elements ends in /lib64 or points to a directory whose absolute - dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the - dnl default, namely "lib". + dnl There is no formal standard regarding lib and lib64. + dnl On 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. We determine + dnl the compiler's default mode by looking at the compiler's library search + dnl path. If at least one of its elements ends in /lib64 or points to a + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. + dnl Otherwise we use the default, 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]) acl_libdirstem=lib - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; + acl_libdirstem2= + case "$host_os" in + solaris*) + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment + dnl . + 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. + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], + [AC_EGREP_CPP([sixtyfour bits], [ +#ifdef _LP64 +sixtyfour bits +#endif + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) + ]) + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi - done - IFS="$acl_save_IFS" - fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) diff --git a/gl/m4/localcharset.m4 b/gl/m4/localcharset.m4 index b2b7733..e960104 100644 --- a/gl/m4/localcharset.m4 +++ b/gl/m4/localcharset.m4 @@ -1,5 +1,5 @@ -# localcharset.m4 serial 5 -dnl Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. +# localcharset.m4 serial 6 +dnl Copyright (C) 2002, 2004, 2006, 2009 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. @@ -8,7 +8,7 @@ AC_DEFUN([gl_LOCALCHARSET], [ dnl Prerequisites of lib/localcharset.c. AC_REQUIRE([AM_LANGINFO_CODESET]) - AC_CHECK_DECLS_ONCE(getc_unlocked) + AC_CHECK_DECLS_ONCE([getc_unlocked]) dnl Prerequisites of the lib/Makefile.am snippet. AC_REQUIRE([AC_CANONICAL_HOST]) diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4 new file mode 100644 index 0000000..653a5bc --- /dev/null +++ b/gl/m4/locale-fr.m4 @@ -0,0 +1,185 @@ +# locale-fr.m4 serial 11 +dnl Copyright (C) 2003, 2005-2009 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([ +changequote(,)dnl +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS 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 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; + /* 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; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS 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 + 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([ +changequote(,)dnl +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +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 (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS 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 + /* 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; + return 0; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS 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 + 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..9360576 --- /dev/null +++ b/gl/m4/locale-ja.m4 @@ -0,0 +1,107 @@ +# locale-ja.m4 serial 7 +dnl Copyright (C) 2003, 2005-2009 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([ +changequote(,)dnl +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS 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 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. */ + 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; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS 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 + 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..36a5f1d --- /dev/null +++ b/gl/m4/locale-zh.m4 @@ -0,0 +1,92 @@ +# locale-zh.m4 serial 6 +dnl Copyright (C) 2003, 2005-2009 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([ +changequote(,)dnl +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS 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 a month name, no byte in the range 0x80..0x9F occurs. + 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) < 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; +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS 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 + 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/longlong.m4 b/gl/m4/longlong.m4 index 15bf9da..eedc8d5 100644 --- a/gl/m4/longlong.m4 +++ b/gl/m4/longlong.m4 @@ -1,5 +1,5 @@ -# longlong.m4 serial 13 -dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. +# longlong.m4 serial 14 +dnl Copyright (C) 1999-2007, 2009 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. @@ -46,7 +46,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ac_cv_type_long_long_int=yes])], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then - AC_DEFINE([HAVE_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type `long long int'.]) fi ]) @@ -69,7 +69,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then - AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) diff --git a/gl/m4/ls-mntd-fs.m4 b/gl/m4/ls-mntd-fs.m4 index 21ac4e7..32ccb98 100644 --- a/gl/m4/ls-mntd-fs.m4 +++ b/gl/m4/ls-mntd-fs.m4 @@ -1,8 +1,7 @@ -#serial 26 +# serial 27 # How to list mounted file systems. -# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software -# Foundation, Inc. +# Copyright (C) 1998-2004, 2006, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,27 +19,27 @@ dnl AC_DEFUN([AC_FUNC_GETMNTENT], [# getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, # -lseq on Dynix/PTX, -lgen on Unixware. -AC_SEARCH_LIBS(getmntent, [sun seq gen]) -AC_CHECK_FUNCS(getmntent) +AC_SEARCH_LIBS([getmntent], [sun seq gen]) +AC_CHECK_FUNCS([getmntent]) ]) # gl_LIST_MOUNTED_FILE_SYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS], [ -AC_CHECK_FUNCS(listmntent getmntinfo) -AC_CHECK_HEADERS_ONCE(sys/param.h sys/statvfs.h) +AC_CHECK_FUNCS([listmntent getmntinfo]) +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 ]) +AC_CHECK_HEADERS([sys/ucred.h], [], [], [#include ]) -AC_CHECK_HEADERS(sys/mount.h, [], [], +AC_CHECK_HEADERS([sys/mount.h], [], [], [AC_INCLUDES_DEFAULT [#if HAVE_SYS_PARAM_H #include #endif]]) -AC_CHECK_HEADERS(mntent.h sys/fs_types.h) +AC_CHECK_HEADERS([mntent.h sys/fs_types.h]) getfsstat_includes="\ $ac_includes_default #if HAVE_SYS_PARAM_H @@ -78,9 +77,9 @@ AC_FUNC_GETMNTENT if test -z "$ac_list_mounted_fs"; then # Cray UNICOS 9 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9]) - AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent, + AC_CACHE_VAL([fu_cv_sys_mounted_cray_listmntent], [fu_cv_sys_mounted_cray_listmntent=no - AC_EGREP_CPP(yes, + AC_EGREP_CPP([yes], [#ifdef _CRAY yes #endif @@ -89,10 +88,10 @@ yes ) ] ) - AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent) + AC_MSG_RESULT([$fu_cv_sys_mounted_cray_listmntent]) if test $fu_cv_sys_mounted_cray_listmntent = yes; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_LISTMNTENT, 1, + AC_DEFINE([MOUNTED_LISTMNTENT], [1], [Define if there is a function named listmntent that can be used to list all mounted file systems. (UNICOS)]) fi @@ -101,14 +100,14 @@ fi if test -z "$ac_list_mounted_fs"; then # AIX. AC_MSG_CHECKING([for mntctl function and struct vmount]) - AC_CACHE_VAL(fu_cv_sys_mounted_vmount, + AC_CACHE_VAL([fu_cv_sys_mounted_vmount], [AC_TRY_CPP([#include ], fu_cv_sys_mounted_vmount=yes, fu_cv_sys_mounted_vmount=no)]) - AC_MSG_RESULT($fu_cv_sys_mounted_vmount) + AC_MSG_RESULT([$fu_cv_sys_mounted_vmount]) if test $fu_cv_sys_mounted_vmount = yes; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_VMOUNT, 1, + 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)]) @@ -123,7 +122,7 @@ if test $ac_cv_func_getmntent = yes; then if test -z "$ac_list_mounted_fs"; then # 4.3BSD, SunOS, HP-UX, Dynix, Irix AC_MSG_CHECKING([for one-argument getmntent function]) - AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1, + AC_CACHE_VAL([fu_cv_sys_mounted_getmntent1], [AC_TRY_COMPILE([ /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */ #include @@ -145,10 +144,10 @@ if test $ac_cv_func_getmntent = yes; then if (sizeof mnt && sizeof table) return 0;], fu_cv_sys_mounted_getmntent1=yes, fu_cv_sys_mounted_getmntent1=no)]) - AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1) + AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent1]) if test $fu_cv_sys_mounted_getmntent1 = yes; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_GETMNTENT1, 1, + 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, Dynix, Irix)]) @@ -158,17 +157,17 @@ if test $ac_cv_func_getmntent = yes; then if test -z "$ac_list_mounted_fs"; then # SVR4 AC_MSG_CHECKING([for two-argument getmntent function]) - AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2, - [AC_EGREP_HEADER(getmntent, sys/mnttab.h, + AC_CACHE_VAL([fu_cv_sys_mounted_getmntent2], + [AC_EGREP_HEADER([getmntent], [sys/mnttab.h], fu_cv_sys_mounted_getmntent2=yes, fu_cv_sys_mounted_getmntent2=no)]) - AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2) + AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent2]) if test $fu_cv_sys_mounted_getmntent2 = yes; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_GETMNTENT2, 1, + 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) + AC_CHECK_FUNCS([hasmntopt]) fi fi @@ -179,7 +178,7 @@ if test -z "$ac_list_mounted_fs"; then # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h AC_MSG_CHECKING([for getfsstat function]) - AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat, + AC_CACHE_VAL([fu_cv_sys_mounted_getfsstat], [AC_TRY_LINK([ #include #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME @@ -194,10 +193,10 @@ if test -z "$ac_list_mounted_fs"; then char *t = FS_TYPE (*stats); ], fu_cv_sys_mounted_getfsstat=yes, fu_cv_sys_mounted_getfsstat=no)]) - AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat) + AC_MSG_RESULT([$fu_cv_sys_mounted_getfsstat]) if test $fu_cv_sys_mounted_getfsstat = yes; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_GETFSSTAT, 1, + 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 @@ -206,17 +205,17 @@ fi if test -z "$ac_list_mounted_fs"; then # SVR3 AC_MSG_CHECKING([for FIXME existence of three headers]) - AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp, + AC_CACHE_VAL([fu_cv_sys_mounted_fread_fstyp], [AC_TRY_CPP([ #include #include #include ], fu_cv_sys_mounted_fread_fstyp=yes, fu_cv_sys_mounted_fread_fstyp=no)]) - AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp) + AC_MSG_RESULT([$fu_cv_sys_mounted_fread_fstyp]) if test $fu_cv_sys_mounted_fread_fstyp = yes; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_FREAD_FSTYP, 1, + 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: and . (SVR3)]) @@ -226,16 +225,16 @@ fi if test -z "$ac_list_mounted_fs"; then # 4.4BSD and DEC OSF/1. AC_MSG_CHECKING([for getmntinfo function]) - AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo, + AC_CACHE_VAL([fu_cv_sys_mounted_getmntinfo], [ test "$ac_cv_func_getmntinfo" = yes \ && fu_cv_sys_mounted_getmntinfo=yes \ || fu_cv_sys_mounted_getmntinfo=no ]) - AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo) + AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo]) if test $fu_cv_sys_mounted_getmntinfo = yes; then AC_MSG_CHECKING([whether getmntinfo returns statvfs structures]) - AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo2, + AC_CACHE_VAL([fu_cv_sys_mounted_getmntinfo2], [ AC_TRY_COMPILE([ #if HAVE_SYS_PARAM_H @@ -256,13 +255,13 @@ extern int getmntinfo (struct statfs **, int); AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo2]) if test $fu_cv_sys_mounted_getmntinfo2 = no; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_GETMNTINFO, 1, + 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 ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_GETMNTINFO2, 1, + 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)]) @@ -273,16 +272,16 @@ fi if test -z "$ac_list_mounted_fs"; then # Ultrix AC_MSG_CHECKING([for getmnt function]) - AC_CACHE_VAL(fu_cv_sys_mounted_getmnt, + AC_CACHE_VAL([fu_cv_sys_mounted_getmnt], [AC_TRY_CPP([ #include #include ], fu_cv_sys_mounted_getmnt=yes, fu_cv_sys_mounted_getmnt=no)]) - AC_MSG_RESULT($fu_cv_sys_mounted_getmnt) + AC_MSG_RESULT([$fu_cv_sys_mounted_getmnt]) if test $fu_cv_sys_mounted_getmnt = yes; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_GETMNT, 1, + AC_DEFINE([MOUNTED_GETMNT], [1], [Define if there is a function named getmnt for reading the list of mounted file systems. (Ultrix)]) fi @@ -290,8 +289,8 @@ fi if test -z "$ac_list_mounted_fs"; then # BeOS - AC_CHECK_FUNCS(next_dev fs_stat_dev) - AC_CHECK_HEADERS(fs_info.h) + AC_CHECK_FUNCS([next_dev fs_stat_dev]) + AC_CHECK_HEADERS([fs_info.h]) AC_MSG_CHECKING([for BEOS mounted file system support functions]) if test $ac_cv_header_fs_info_h = yes \ && test $ac_cv_func_next_dev = yes \ @@ -300,10 +299,10 @@ if test -z "$ac_list_mounted_fs"; then else fu_result=no fi - AC_MSG_RESULT($fu_result) + AC_MSG_RESULT([$fu_result]) if test $fu_result = yes; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_FS_STAT_DEV, 1, + 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 @@ -312,14 +311,14 @@ fi if test -z "$ac_list_mounted_fs"; then # SVR2 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab]) - AC_CACHE_VAL(fu_cv_sys_mounted_fread, + AC_CACHE_VAL([fu_cv_sys_mounted_fread], [AC_TRY_CPP([#include ], fu_cv_sys_mounted_fread=yes, fu_cv_sys_mounted_fread=no)]) - AC_MSG_RESULT($fu_cv_sys_mounted_fread) + AC_MSG_RESULT([$fu_cv_sys_mounted_fread]) if test $fu_cv_sys_mounted_fread = yes; then ac_list_mounted_fs=found - AC_DEFINE(MOUNTED_FREAD, 1, + AC_DEFINE([MOUNTED_FREAD], [1], [Define if there is no specific function for reading the list of mounted file systems. fread will be used to read /etc/mnttab. (SVR2) ]) diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4 index 764f2a9..8070171 100644 --- a/gl/m4/malloc.m4 +++ b/gl/m4/malloc.m4 @@ -1,5 +1,5 @@ -# malloc.m4 serial 8 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# malloc.m4 serial 9 +dnl Copyright (C) 2007, 2009 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. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX], AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then HAVE_MALLOC_POSIX=1 - AC_DEFINE([HAVE_MALLOC_POSIX], 1, + AC_DEFINE([HAVE_MALLOC_POSIX], [1], [Define if the 'malloc' function is POSIX compliant.]) else AC_LIBOBJ([malloc]) diff --git a/gl/m4/math_h.m4 b/gl/m4/math_h.m4 index dd99e7f..d941bc3 100644 --- a/gl/m4/math_h.m4 +++ b/gl/m4/math_h.m4 @@ -1,4 +1,4 @@ -# math_h.m4 serial 9 +# math_h.m4 serial 14 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,6 +8,31 @@ AC_DEFUN([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 ]], + [[/* 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 ]], + [[/* 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 ]) AC_DEFUN([gl_MATH_MODULE_INDICATOR], @@ -26,6 +51,11 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP]) GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL]) GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE]) + GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF]) + GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN]) + GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF]) + GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND]) + GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL]) GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL]) GNULIB_MATHL=0; AC_SUBST([GNULIB_MATHL]) GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND]) @@ -36,6 +66,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF]) + HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND]) + HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL]) 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]) @@ -49,18 +82,22 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], 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_CEILF=0; AC_SUBST([REPLACE_CEILF]) REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) + REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL]) 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_NAN=0; AC_SUBST([REPLACE_NAN]) 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_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC]) + REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL]) ]) diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4 new file mode 100644 index 0000000..11d7d23 --- /dev/null +++ b/gl/m4/mbrtowc.m4 @@ -0,0 +1,382 @@ +# mbrtowc.m4 serial 15 +dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 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_MBRTOWC], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + fi + AC_CHECK_FUNCS_ONCE([mbrtowc]) + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + fi + if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then + gl_MBRTOWC_NULL_ARG + gl_MBRTOWC_RETVAL + gl_MBRTOWC_NUL_RETVAL + case "$gl_cv_func_mbrtowc_null_arg" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NULL_ARG_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 + fi + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([mbrtowc]) + gl_PREREQ_MBRTOWC + fi +]) + +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_TYPE_MBSTATE_T]) + AC_CHECK_FUNCS_ONCE([mbsinit]) + AC_CHECK_FUNCS_ONCE([mbrtowc]) + if test $ac_cv_func_mbsinit = yes && 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 + if test $REPLACE_MBSTATE_T = 1; then + gl_REPLACE_WCHAR_H + 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([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. + 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_TRY_RUN([ +#include +#include +#include +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 1; + } + return 0; +}], + [gl_cv_func_mbrtowc_incomplete_state=yes], + [gl_cv_func_mbrtowc_incomplete_state=no], + [:]) + 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_TRY_RUN([ +#include +#include +#include +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 1; + } + return 0; +}], + [gl_cv_func_mbrtowc_sanitycheck=yes], + [gl_cv_func_mbrtowc_sanitycheck=no], + [:]) + fi + ]) +]) + +dnl Test whether mbrtowc supports a NULL string argument correctly. +dnl Result is gl_cv_func_mbrtowc_null_arg. + +AC_DEFUN([gl_MBRTOWC_NULL_ARG], +[ + 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_arg], + [ + 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_arg="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none; then + AC_TRY_RUN([ +#include +#include +#include +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 1; + } + return 0; +}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=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]) dnl for cross-compiles + 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 and Solaris. + hpux* | solaris*) 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; then + AC_TRY_RUN([ +#include +#include +#include +int main () +{ + /* 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) + return 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) + return 1; + } + } + return 0; +}], + [gl_cv_func_mbrtowc_retval=yes], + [gl_cv_func_mbrtowc_retval=no], + [:]) + 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_TRY_RUN([ +#include +#include +#include +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 1; + } + return 0; +}], + [gl_cv_func_mbrtowc_nul_retval=yes], + [gl_cv_func_mbrtowc_nul_retval=no], + [:]) + fi + ]) +]) + +# Prerequisites of lib/mbrtowc.c. +AC_DEFUN([gl_PREREQ_MBRTOWC], [ + : +]) + + +dnl From Paul Eggert + +dnl This override of an autoconf macro can be removed when autoconf 2.60 or +dnl newer can be assumed everywhere. + +m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.60]),[-1],[ +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_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..03b055c --- /dev/null +++ b/gl/m4/mbsinit.m4 @@ -0,0 +1,30 @@ +# mbsinit.m4 serial 3 +dnl Copyright (C) 2008 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_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + fi + AC_CHECK_FUNCS_ONCE([mbsinit]) + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + fi + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([mbsinit]) + gl_PREREQ_MBSINIT + 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 index df2a275..d4ec6f0 100644 --- a/gl/m4/mbstate_t.m4 +++ b/gl/m4/mbstate_t.m4 @@ -1,5 +1,5 @@ -# mbstate_t.m4 serial 9 -dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +# mbstate_t.m4 serial 12 +dnl Copyright (C) 2000-2002, 2008, 2009 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. @@ -13,18 +13,22 @@ dnl with or without modifications, as long as this notice is preserved. # AC_TYPE_MBSTATE_T # ----------------- AC_DEFUN([AC_TYPE_MBSTATE_T], - [AC_CACHE_CHECK([for mbstate_t], ac_cv_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 ], - [mbstate_t x; return sizeof x;])], + [AC_INCLUDES_DEFAULT[ +# include ]], + [[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, + AC_DEFINE([HAVE_MBSTATE_T], [1], [Define to 1 if declares mbstate_t.]) else - AC_DEFINE([mbstate_t], int, + AC_DEFINE([mbstate_t], [int], [Define to a type if does not define.]) - fi]) + fi +]) diff --git a/gl/m4/mktime.m4 b/gl/m4/mktime.m4 new file mode 100644 index 0000000..1e926e8 --- /dev/null +++ b/gl/m4/mktime.m4 @@ -0,0 +1,231 @@ +# serial 15 +dnl Copyright (C) 2002-2003, 2005-2007, 2009 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. + +# Redefine AC_FUNC_MKTIME, to fix a bug in Autoconf 2.61a and earlier. +# This redefinition can be removed once a new version of Autoconf is assumed. +# The redefinition is taken from +# . +# AC_FUNC_MKTIME +# -------------- +AC_DEFUN([AC_FUNC_MKTIME], +[AC_CHECK_HEADERS_ONCE([unistd.h]) +AC_CHECK_FUNCS_ONCE([alarm]) +AC_REQUIRE([gl_MULTIARCH]) +if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple MacOS 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. + ac_cv_func_working_mktime=no +fi +AC_CACHE_CHECK([for working mktime], [ac_cv_func_working_mktime], +[AC_RUN_IFELSE([AC_LANG_SOURCE( +[[/* Test program from Paul Eggert and Tony Leneis. */ +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef HAVE_ALARM +# define alarm(X) /* empty */ +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +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. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + 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. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + 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)); +} + +int +main () +{ + time_t t, delta; + int i, j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + alarm (60); + + for (;;) + { + t = (time_t_max << 1) + 1; + if (t <= time_t_max) + break; + time_t_max = t; + } + time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - 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; t += delta) + if (! mktime_test (t)) + return 1; + if (! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + return 1; + + for (j = 1; ; j <<= 1) + if (! bigtime_test (j)) + return 1; + else if (INT_MAX / 2 < j) + break; + if (! bigtime_test (INT_MAX)) + return 1; + } + return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); +}]])], + [ac_cv_func_working_mktime=yes], + [ac_cv_func_working_mktime=no], + [ac_cv_func_working_mktime=no])]) +if test $ac_cv_func_working_mktime = no; then + AC_LIBOBJ([mktime]) +fi +])# AC_FUNC_MKTIME + +AC_DEFUN([gl_FUNC_MKTIME], +[ + AC_FUNC_MKTIME + dnl Note: AC_FUNC_MKTIME does AC_LIBOBJ([mktime]). + if test $ac_cv_func_working_mktime = no; then + AC_DEFINE([mktime], [rpl_mktime], + [Define to rpl_mktime if the replacement function should be used.]) + gl_PREREQ_MKTIME + fi +]) + +# Prerequisites of lib/mktime.c. +AC_DEFUN([gl_PREREQ_MKTIME], +[ + AC_REQUIRE([AC_C_INLINE]) +]) diff --git a/gl/m4/mountlist.m4 b/gl/m4/mountlist.m4 index c25f44e..f62c57a 100644 --- a/gl/m4/mountlist.m4 +++ b/gl/m4/mountlist.m4 @@ -1,5 +1,5 @@ -#serial 9 -dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# serial 10 +dnl Copyright (C) 2002-2006, 2009 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. @@ -9,7 +9,7 @@ AC_DEFUN([gl_MOUNTLIST], gl_LIST_MOUNTED_FILE_SYSTEMS([gl_cv_list_mounted_fs=yes], [gl_cv_list_mounted_fs=no]) if test $gl_cv_list_mounted_fs = yes; then - AC_LIBOBJ(mountlist) + AC_LIBOBJ([mountlist]) gl_PREREQ_MOUNTLIST_EXTRA fi ]) @@ -18,6 +18,6 @@ AC_DEFUN([gl_MOUNTLIST], AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA], [ dnl Note gl_LIST_MOUNTED_FILE_SYSTEMS checks for mntent.h, not sys/mntent.h. - AC_CHECK_HEADERS(sys/mntent.h) + AC_CHECK_HEADERS([sys/mntent.h]) gl_FSTYPENAME ]) diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4 new file mode 100644 index 0000000..ec377ba --- /dev/null +++ b/gl/m4/multiarch.m4 @@ -0,0 +1,65 @@ +# multiarch.m4 serial 5 +dnl Copyright (C) 2008, 2009 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 MacOS 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 the macro AA_APPLE_UNIVERSAL_BUILD at the +# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly. + +AC_DEFUN_ONCE([gl_MULTIARCH], +[ + dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. + 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) + 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 + AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1], + [Define if the compiler is building for multiple architectures of Apple platforms at once.]) + 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..5a12251 --- /dev/null +++ b/gl/m4/netdb_h.m4 @@ -0,0 +1,45 @@ +# netdb_h.m4 serial 5 +dnl Copyright (C) 2008 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_NETDB], +[ + AC_REQUIRE([gl_NETDB_H_DEFAULTS]) + gl_CHECK_NEXT_HEADERS([netdb.h]) + if test $ac_cv_header_netdb_h = yes; then + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include + struct addrinfo a; + int b = EAI_OVERFLOW; + int c = AI_NUMERICSERV; + ]])], + [NETDB_H=''], [NETDB_H='netdb.h']) + HAVE_NETDB_H=1 + else + NETDB_H='netdb.h' + HAVE_NETDB_H=0 + fi + AC_SUBST([HAVE_NETDB_H]) + AC_SUBST([NETDB_H]) +]) + +AC_DEFUN([gl_NETDB_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_NETDB_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_NETDB_H_DEFAULTS], +[ + GNULIB_GETADDRINFO=0; AC_SUBST([GNULIB_GETADDRINFO]) + 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]) +]) diff --git a/gl/m4/netinet_in_h.m4 b/gl/m4/netinet_in_h.m4 index 096be74..47fd9cc 100644 --- a/gl/m4/netinet_in_h.m4 +++ b/gl/m4/netinet_in_h.m4 @@ -1,5 +1,5 @@ -# netinet_in_h.m4 serial 3 -dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +# netinet_in_h.m4 serial 4 +dnl Copyright (C) 2006-2008 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. @@ -9,7 +9,7 @@ AC_DEFUN([gl_HEADER_NETINET_IN], AC_CACHE_CHECK([whether is self-contained], [gl_cv_header_netinet_in_h_selfcontained], [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [])], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], [gl_cv_header_netinet_in_h_selfcontained=yes], [gl_cv_header_netinet_in_h_selfcontained=no]) ]) diff --git a/gl/m4/nls.m4 b/gl/m4/nls.m4 index 7967cc2..0b36434 100644 --- a/gl/m4/nls.m4 +++ b/gl/m4/nls.m4 @@ -1,5 +1,5 @@ -# nls.m4 serial 3 (gettext-0.15) -dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008, 2009 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. @@ -17,15 +17,15 @@ dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS - AC_ARG_ENABLE(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) + AC_MSG_RESULT([$USE_NLS]) + AC_SUBST([USE_NLS]) ]) diff --git a/gl/m4/onceonly_2_57.m4 b/gl/m4/onceonly.m4 similarity index 77% rename from gl/m4/onceonly_2_57.m4 rename to gl/m4/onceonly.m4 index 15884b3..108cd6c 100644 --- a/gl/m4/onceonly_2_57.m4 +++ b/gl/m4/onceonly.m4 @@ -1,5 +1,5 @@ -# onceonly_2_57.m4 serial 4 -dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. +# onceonly.m4 serial 6 +dnl Copyright (C) 2002-2003, 2005-2006, 2008 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program @@ -21,19 +21,23 @@ dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to dnl empty, and the check will be inserted before the body of the AC_DEFUNed dnl function. -dnl This is like onceonly.m4, except that it uses diversions to named sections -dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once, -dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The -dnl size reduction is ca. 9%. +dnl The original code implemented AC_CHECK_HEADERS_ONCE and AC_CHECK_FUNCS_ONCE +dnl in terms of AC_DEFUN and AC_REQUIRE. This implementation uses diversions to +dnl named sections DEFAULTS and INIT_PREPARE in order to check all requested +dnl headers at once, thus reducing the size of 'configure'. It is known to work +dnl with autoconf 2.57..2.62 at least . The size reduction is ca. 9%. -dnl Autoconf version 2.57 or newer is recommended. -AC_PREREQ(2.57) +dnl Autoconf version 2.59 plus gnulib is required; this file is not needed +dnl with Autoconf 2.60 or greater. But note that autoconf's implementation of +dnl AC_CHECK_DECLS_ONCE expects a comma-separated list of symbols as first +dnl argument! +AC_PREREQ([2.59]) # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of # AC_CHECK_HEADERS(HEADER1 HEADER2 ...). AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ : - AC_FOREACH([gl_HEADER_NAME], [$1], [ + m4_foreach_w([gl_HEADER_NAME], [$1], [ AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, [./-], [___])), [ m4_divert_text([INIT_PREPARE], @@ -56,7 +60,7 @@ m4_define([gl_HEADERS_EXPANSION], [ # AC_CHECK_FUNCS(FUNC1 FUNC2 ...). AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ : - AC_FOREACH([gl_FUNC_NAME], [$1], [ + m4_foreach_w([gl_FUNC_NAME], [$1], [ AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ m4_divert_text([INIT_PREPARE], [gl_func_list="$gl_func_list gl_FUNC_NAME"]) @@ -77,7 +81,7 @@ m4_define([gl_FUNCS_EXPANSION], [ # AC_CHECK_DECLS(DECL1, DECL2, ...). AC_DEFUN([AC_CHECK_DECLS_ONCE], [ : - AC_FOREACH([gl_DECL_NAME], [$1], [ + m4_foreach_w([gl_DECL_NAME], [$1], [ AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) ]) diff --git a/gl/m4/open.m4 b/gl/m4/open.m4 new file mode 100644 index 0000000..6e286c9 --- /dev/null +++ b/gl/m4/open.m4 @@ -0,0 +1,66 @@ +# open.m4 serial 5 +dnl Copyright (C) 2007-2009 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]) + case "$host_os" in + mingw* | pw*) + gl_REPLACE_OPEN + ;; + *) + dnl open("foo/") should not create a file when the file name has a + dnl trailing slash. + AC_CACHE_CHECK([whether open recognizes a trailing slash], + [gl_cv_func_open_slash], + [ + AC_TRY_RUN([ +#include +#if HAVE_UNISTD_H +# include +#endif +int main () +{ + return open ("conftest.sl/", O_CREAT, 0600) >= 0; +}], [gl_cv_func_open_slash=yes], [gl_cv_func_open_slash=no], + [ +changequote(,)dnl + case "$host_os" in + solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;; + hpux*) gl_cv_func_open_slash="guessing no" ;; + *) gl_cv_func_open_slash="guessing yes" ;; + esac +changequote([,])dnl + ]) + rm -f conftest.sl + ]) + 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.]) + gl_REPLACE_OPEN + ;; + esac + ;; + esac +]) + +AC_DEFUN([gl_REPLACE_OPEN], +[ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + if test $REPLACE_OPEN != 1; then + AC_LIBOBJ([open]) + gl_PREREQ_OPEN + fi + REPLACE_OPEN=1 +]) + +# Prerequisites of lib/open.c. +AC_DEFUN([gl_PREREQ_OPEN], +[ + AC_REQUIRE([AC_C_INLINE]) + : +]) diff --git a/gl/m4/po.m4 b/gl/m4/po.m4 index 0734762..2284fa5 100644 --- a/gl/m4/po.m4 +++ b/gl/m4/po.m4 @@ -1,5 +1,5 @@ -# po.m4 serial 15 (gettext-0.17) -dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. +# po.m4 serial 17 (gettext-0.18) +dnl Copyright (C) 1995-2009 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. @@ -17,7 +17,7 @@ dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], @@ -41,7 +41,7 @@ AC_DEFUN([AM_PO_SUBDIRS], [$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) + AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4 new file mode 100644 index 0000000..87aa45c --- /dev/null +++ b/gl/m4/printf.m4 @@ -0,0 +1,1416 @@ +# printf.m4 serial 33 +dnl Copyright (C) 2003, 2007-2009 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_TRY_RUN([ +#include +#include +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +# include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +# include +#endif +static char buf[100]; +int main () +{ +#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) + return 1; +#endif + buf[0] = '\0'; + if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 + || strcmp (buf, "12345672 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 + || strcmp (buf, "12345673 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 + || strcmp (buf, "1.5 33") != 0) + return 1; + return 0; +}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) 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";; + # Guess yes on MacOS 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.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";; + solaris*) gl_cv_func_printf_sizes_c99="guessing yes";; + # 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";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_sizes_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +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_TRY_RUN([ +#include +#include +static char buf[10000]; +int main () +{ + buf[0] = '\0'; + if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000e+00 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.75 33") != 0) + return 1; + return 0; +}], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no], + [ +changequote(,)dnl + case "$host_os" in + beos*) gl_cv_func_printf_long_double="guessing no";; + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; + *) gl_cv_func_printf_long_double="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +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_TRY_RUN([ +#include +#include +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 () +{ + if (sprintf (buf, "%f", 1.0 / 0.0) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%f", -1.0 / 0.0) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%f", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%e", 1.0 / 0.0) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%e", -1.0 / 0.0) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%e", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%g", 1.0 / 0.0) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%g", -1.0 / 0.0) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%g", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + /* This test fails on HP-UX 10.20. */ + if (have_minus_zero ()) + if (sprintf (buf, "%g", - zero) < 0 + || strcmp (buf, "-0") != 0) + return 1; + return 0; +}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) 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";; + # Guess yes on MacOS 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 BeOS. + beos*) gl_cv_func_printf_infinite="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +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([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_TRY_RUN([ +]GL_NOCRASH[ +#include +#include +#include +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 () +{ + nocrash_init(); + if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%Le", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 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_)) +/* 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))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { + /* 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))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-Infinity. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-Zero. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Unnormalized number. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-Denormal. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } +#endif + return 0; +}], + [gl_cv_func_printf_infinite_long_double=yes], + [gl_cv_func_printf_infinite_long_double=no], + [ +changequote(,)dnl + 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 + # Guess yes on glibc systems. + *-gnu*) 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";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";; + darwin*) 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 NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite_long_double="guessing no";; + netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite_long_double="guessing no";; + esac + ;; + esac +changequote([,])dnl + ]) + ]) + ;; + *) + 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_TRY_RUN([ +#include +#include +static char buf[100]; +int main () +{ + 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)) + return 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)) + return 1; + /* This catches a FreeBSD 6.1 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)) + return 1; + /* This catches a FreeBSD 6.1 bug. See + */ + if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0 + || buf[0] == '0') + return 1; + /* This catches a MacOS 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)) + return 1; + /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a + glibc 2.4 bug . */ + 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)) + return 1; + return 0; +}], [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*) + AC_EGREP_CPP([BZ2908], [ + #include + #ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2) + BZ2908 + #endif + #endif + ], + [gl_cv_func_printf_directive_a="guessing yes"], + [gl_cv_func_printf_directive_a="guessing no"]) + ;; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_a="guessing no";; + 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_TRY_RUN([ +#include +#include +static char buf[100]; +int main () +{ + if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 + || strcmp (buf, "1234567.000000 33") != 0) + return 1; + if (sprintf (buf, "%F", 1.0 / 0.0) < 0 + || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) + return 1; + /* This catches a Cygwin 1.5.x bug. */ + if (sprintf (buf, "%.F", 1234.0) < 0 + || strcmp (buf, "1234") != 0) + return 1; + return 0; +}], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) 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";; + # Guess yes on MacOS 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 Solaris >= 2.10. + solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";; + solaris*) gl_cv_func_printf_directive_f="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_f="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +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_TRY_RUN([ +#include +#include +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"); + 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], + [ +changequote(,)dnl + case "$host_os" in + *) gl_cv_func_printf_directive_n="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +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_TRY_RUN([ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +#include +int main () +{ + 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) + return 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) + return 1; + } + /* 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) + return 1; + } + return 0; +}], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no], + [ +changequote(,)dnl + case "$host_os" in + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + 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";; + *) 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_TRY_RUN([ +#include +#include +/* 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";; + 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_TRY_RUN([ +#include +#include +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";; + 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 +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_TRY_RUN([ +#include +#include +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 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 +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_TRY_RUN([ +#include +#include +static char buf[100]; +int main () +{ + if (sprintf (buf, "%010f", 1.0 / 0.0, 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*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_flag_zero="guessing no";; + 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 BeOS, precisions larger than 1044 +dnl 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_TRY_RUN([ +#include +#include +static char buf[5000]; +int main () +{ +#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) + return 1; + return 0; +}], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no only on native Win32 and BeOS systems. + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + *) 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[ +changequote(,)dnl +#include +#include +#include +#include +#include +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)); +} +changequote([,])dnl + ])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + (./conftest + 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 MacOS 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*) 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";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_enomem="guessing no";; + 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([gl_SNPRINTF_TRUNCATION_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether snprintf truncates the result as in C99], + [gl_cv_func_snprintf_truncation_c99], + [ + AC_TRY_RUN([ +#include +#include +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + 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*) 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";; + # Guess yes on MacOS 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]*) 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";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_truncation_c99="guessing no";; + 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 +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([gl_SNPRINTF_RETVAL_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether snprintf returns a byte count as in C99], + [gl_cv_func_snprintf_retval_c99], + [ + AC_TRY_RUN([ +#include +#include +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + return 0; +}], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) 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";; + # Guess yes on MacOS 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.6. + solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";; + solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # 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";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +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_CACHE_CHECK([whether snprintf fully supports the 'n' directive], + [gl_cv_func_snprintf_directive_n], + [ + AC_TRY_RUN([ +#include +#include +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"); + 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], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) 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";; + # Guess yes on MacOS 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]*) 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";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_directive_n="guessing no";; + esac +changequote([,])dnl + ]) + ]) +]) + +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_CACHE_CHECK([whether snprintf respects a size of 1], + [gl_cv_func_snprintf_size1], + [ + AC_TRY_RUN([ +#include +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +}], + [gl_cv_func_snprintf_size1=yes], + [gl_cv_func_snprintf_size1=no], + [gl_cv_func_snprintf_size1="guessing yes"]) + ]) +]) + +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 +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 +dnl #include +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_TRY_RUN([ +#include +#include +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*) 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";; + # Guess yes on MacOS 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]*) 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 mingw. + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + 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 5.4, 6.1 . . . . # . . . . . . # . # . . . . . . +dnl MacOS X 10.3.9 . . . . # . . . . . . # . # . . . . . . +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 10 . . # # # . . # . . . # . . . . . . . . +dnl Solaris 2.6 ... 9 # . # # # # . # . . . # . . . . . . . . +dnl Solaris 2.5.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 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ? +dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . . +dnl Haiku . . . # # # . # . . . . . ? . . . . . . +dnl BeOS # # . # # # . ? # . ? . # ? . . . . . . +dnl mingw # # # # # # . . # # . # # ? . # # # . . diff --git a/gl/m4/progtest.m4 b/gl/m4/progtest.m4 index a56365c..e1d445d 100644 --- a/gl/m4/progtest.m4 +++ b/gl/m4/progtest.m4 @@ -1,5 +1,5 @@ -# progtest.m4 serial 4 (gettext-0.14.2) -dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. +# progtest.m4 serial 6 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2005, 2008, 2009 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. @@ -16,7 +16,7 @@ dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) # Search path for a program which passes the given test. @@ -55,7 +55,7 @@ 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, +AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. @@ -84,9 +84,9 @@ ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then - AC_MSG_RESULT([$]$1) + AC_MSG_RESULT([$][$1]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi -AC_SUBST($1)dnl +AC_SUBST([$1])dnl ]) diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4 index 7da6efe..aef53d2 100644 --- a/gl/m4/regex.m4 +++ b/gl/m4/regex.m4 @@ -1,7 +1,7 @@ -#serial 48 +# serial 54 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,13 +17,10 @@ AC_DEFUN([gl_REGEX], AC_CHECK_HEADERS_ONCE([locale.h]) AC_ARG_WITH([included-regex], - [AC_HELP_STRING([--without-included-regex], - [don't compile regex; this is the default on 32-bit - systems with recent-enough versions of the GNU C - Library (use with caution on other systems). - On systems with 64-bit ptrdiff_t and 32-bit int, - --with-included-regex is the default, in case - regex functions operate on very long strings (>2GB)])]) + [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 @@ -37,13 +34,13 @@ AC_DEFUN([gl_REGEX], [gl_cv_func_re_compile_pattern_working], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT + [AC_INCLUDES_DEFAULT[ #if HAVE_LOCALE_H #include #endif #include #include - ], + ]], [[static struct re_pattern_buffer regex; unsigned char folded_chars[UCHAR_MAX + 1]; int i; @@ -175,7 +172,7 @@ AC_DEFUN([gl_REGEX], esac if test $ac_use_included_regex = yes; then - AC_DEFINE([_REGEX_LARGE_OFFSETS], 1, + 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.]) @@ -217,6 +214,8 @@ AC_DEFUN([gl_PREREQ_REGEX], [ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([AC_C_RESTRICT]) - AC_CHECK_FUNCS_ONCE([isblank iswctype mbrtowc wcrtomb wcscoll]) + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + AC_CHECK_HEADERS([libintl.h]) + AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll]) AC_CHECK_DECLS([isblank], [], [], [#include ]) ]) diff --git a/gl/m4/servent.m4 b/gl/m4/servent.m4 new file mode 100644 index 0000000..242f9e3 --- /dev/null +++ b/gl/m4/servent.m4 @@ -0,0 +1,47 @@ +# servent.m4 serial 1 +dnl Copyright (C) 2008 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, 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_HEADER_SYS_SOCKET])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_TRY_LINK([ +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include +], [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/size_max.m4 b/gl/m4/size_max.m4 index 6cb4868..e0e7b3f 100644 --- a/gl/m4/size_max.m4 +++ b/gl/m4/size_max.m4 @@ -1,5 +1,5 @@ -# size_max.m4 serial 6 -dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. +# size_max.m4 serial 7 +dnl Copyright (C) 2003, 2005-2006, 2008 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. @@ -8,7 +8,7 @@ dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ - AC_CHECK_HEADERS(stdint.h) + AC_CHECK_HEADERS([stdint.h]) dnl First test whether the system already has SIZE_MAX. AC_MSG_CHECKING([for SIZE_MAX]) AC_CACHE_VAL([gl_cv_size_max], [ @@ -21,16 +21,16 @@ AC_DEFUN([gl_SIZE_MAX], #ifdef SIZE_MAX Found it #endif -], gl_cv_size_max=yes) +], [gl_cv_size_max=yes]) if test -z "$gl_cv_size_max"; 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 -#include ], size_t_bits_minus_1=) +#include ], [size_t_bits_minus_1=]) AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], - [#include ], fits_in_uint=) + [#include ], [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 @@ -38,7 +38,7 @@ Found it AC_TRY_COMPILE([#include extern size_t foo; extern unsigned long foo; - ], [], fits_in_uint=0) + ], [], [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 diff --git a/gl/m4/snprintf.m4 b/gl/m4/snprintf.m4 index f21200d..6021786 100644 --- a/gl/m4/snprintf.m4 +++ b/gl/m4/snprintf.m4 @@ -1,5 +1,5 @@ -# snprintf.m4 serial 4 -dnl Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. +# snprintf.m4 serial 5 +dnl Copyright (C) 2002-2004, 2007-2008 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. @@ -7,8 +7,17 @@ dnl with or without modifications, as long as this notice is preserved. 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 = no; then + if test $ac_cv_func_snprintf = yes; then + gl_SNPRINTF_SIZE1 + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then gl_REPLACE_SNPRINTF fi AC_CHECK_DECLS_ONCE([snprintf]) diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4 index 25d9755..99ea06f 100644 --- a/gl/m4/sockpfaf.m4 +++ b/gl/m4/sockpfaf.m4 @@ -1,5 +1,5 @@ -# sockpfaf.m4 serial 5 -dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc. +# sockpfaf.m4 serial 6 +dnl Copyright (C) 2004, 2006, 2009 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. @@ -16,8 +16,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES], AC_REQUIRE([gl_HEADER_SYS_SOCKET]) AC_CHECK_HEADERS_ONCE([netinet/in.h]) - AC_MSG_CHECKING(for IPv4 sockets) - AC_CACHE_VAL(gl_cv_socket_ipv4, + AC_MSG_CHECKING([for IPv4 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv4], [AC_TRY_COMPILE([#include #ifdef HAVE_SYS_SOCKET_H #include @@ -31,13 +31,13 @@ AC_DEFUN([gl_SOCKET_FAMILIES], [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)]) - AC_MSG_RESULT($gl_cv_socket_ipv4) + AC_MSG_RESULT([$gl_cv_socket_ipv4]) if test $gl_cv_socket_ipv4 = yes; then - AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if defines AF_INET.]) + AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if defines AF_INET.]) fi - AC_MSG_CHECKING(for IPv6 sockets) - AC_CACHE_VAL(gl_cv_socket_ipv6, + AC_MSG_CHECKING([for IPv6 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv6], [AC_TRY_COMPILE([#include #ifdef HAVE_SYS_SOCKET_H #include @@ -51,8 +51,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES], [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)]) - AC_MSG_RESULT($gl_cv_socket_ipv6) + AC_MSG_RESULT([$gl_cv_socket_ipv6]) if test $gl_cv_socket_ipv6 = yes; then - AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if defines AF_INET6.]) + AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if defines AF_INET6.]) fi ]) diff --git a/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4 index 2204ecd..57c804a 100644 --- a/gl/m4/stdbool.m4 +++ b/gl/m4/stdbool.m4 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009 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. @@ -111,5 +111,5 @@ AC_DEFUN([AC_HEADER_STDBOOL], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) + AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.]) fi]) diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4 index bb6c34f..a2e8bdd 100644 --- a/gl/m4/stdint.m4 +++ b/gl/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 29 -dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. +# stdint.m4 serial 34 +dnl Copyright (C) 2001-2009 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. @@ -9,7 +9,7 @@ dnl Test whether is supported or must be substituted. AC_DEFUN([gl_STDINT_H], [ - AC_PREREQ(2.59)dnl + AC_PREREQ([2.59])dnl dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) @@ -201,7 +201,75 @@ struct s { int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; ]])], - [gl_cv_header_working_stdint_h=yes])]) + [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 __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +] +gl_STDINT_INCLUDES +[ +#include +#include +#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 1; + } + return 0; +]])], + [gl_cv_header_working_stdint_h=yes], + [], + [dnl When cross-compiling, assume it works. + gl_cv_header_working_stdint_h=yes + ]) + ]) + ]) fi if test "$gl_cv_header_working_stdint_h" = yes; then STDINT_H= @@ -229,7 +297,7 @@ struct s { gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi - AC_SUBST(STDINT_H) + AC_SUBST([STDINT_H]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) @@ -240,7 +308,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF], 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. - AC_FOREACH([gltype], [$1], + m4_foreach_w([gltype], [$1], [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to the number of bits in type ']gltype['.])]) for gltype in $1 ; do @@ -265,7 +333,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF], AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) eval BITSIZEOF_${GLTYPE}=\$result done - AC_FOREACH([gltype], [$1], + m4_foreach_w([gltype], [$1], [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) @@ -278,7 +346,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED], 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. - AC_FOREACH([gltype], [$1], + m4_foreach_w([gltype], [$1], [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to 1 if ']gltype[' is a signed integer type.])]) for gltype in $1 ; do @@ -292,13 +360,13 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED], 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) + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 fi done - AC_FOREACH([gltype], [$1], + m4_foreach_w([gltype], [$1], [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) @@ -311,7 +379,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], 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. - AC_FOREACH([gltype], [$1], + m4_foreach_w([gltype], [$1], [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], [Define to l, ll, u, ul, ull, etc., as suitable for constants of type ']gltype['.])]) @@ -337,9 +405,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], ui64)gltype1='unsigned __int64';; esac AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([$2 + [AC_LANG_PROGRAM([$2[ extern $gltype foo; - extern $gltype1 foo;])], + extern $gltype1 foo;]])], [eval gl_cv_type_${gltype}_suffix=\$glsuf]) eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break @@ -348,9 +416,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result - AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) done - AC_FOREACH([gltype], [$1], + m4_foreach_w([gltype], [$1], [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) ]) @@ -373,13 +441,22 @@ 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], [ - gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], + 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 - gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], + 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]) ]) diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4 index db9a8ac..82f0c24 100644 --- a/gl/m4/stdint_h.m4 +++ b/gl/m4/stdint_h.m4 @@ -1,5 +1,5 @@ -# stdint_h.m4 serial 6 -dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. +# stdint_h.m4 serial 8 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 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. @@ -11,15 +11,15 @@ dnl From Paul Eggert. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ - AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, + AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1; return !i;], - gl_cv_header_stdint_h=yes, - gl_cv_header_stdint_h=no)]) + [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, + AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4 index a40d418..846b65d 100644 --- a/gl/m4/stdio_h.m4 +++ b/gl/m4/stdio_h.m4 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 9 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# stdio_h.m4 serial 15 +dnl Copyright (C) 2007-2009 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. @@ -8,6 +8,28 @@ AC_DEFUN([gl_STDIO_H], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([stdio.h]) + dnl No need to create extra modules for these functions. Everyone who uses + dnl likely needs them. + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + dnl This ifdef is just an optimization, to avoid performing a configure + dnl check whose result is not used. 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 + AC_LIBOBJ([stdio-write]) + fi + ]) ]) AC_DEFUN([gl_STDIO_MODULE_INDICATOR], @@ -19,49 +41,75 @@ AC_DEFUN([gl_STDIO_MODULE_INDICATOR], AC_DEFUN([gl_STDIO_H_DEFAULTS], [ - GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) - GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) - GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) - GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) - GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) - GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) - GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) - GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) - GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) - GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) - GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) - GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) - GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) - GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) - GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) - GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) - GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) - GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) + GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF]) + GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) + GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF]) + GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) + GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) + GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) + GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF]) + GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) + GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF]) + GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) + GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) + GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) + GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) + GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) + GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) + GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) + GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) + GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) + GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) + GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) + GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) + GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) + GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) + GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE]) + GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC]) + GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC]) + GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR]) + GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS]) + GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS]) + GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE]) + GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) + GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) + GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR]) + GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE]) dnl Assume proper GNU behavior unless another module says otherwise. - REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) - REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) - REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) - REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) - REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) - HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) - REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) - HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) - REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) - REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) - HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) - REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) - REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) - REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) - HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) - REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) - REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) - HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) - REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) - REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) - REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) - HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) - HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) - REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) + REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS]) + REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) + REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) + REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) + REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) + REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) + HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) + REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) + HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) + REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) + REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) + HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) + REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) + HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) + REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) + HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) + REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) + HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) + REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF]) + REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) + REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) + HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) + REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) + REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) + HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) + REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) + REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) + REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) + REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE]) + HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) + HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) + REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) + REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR]) ]) dnl Code shared by fseeko and ftello. Determine if large files are supported, @@ -70,8 +118,8 @@ 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 ], -[#if defined __SL64 && defined __SCLE /* cygwin */ + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[#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. */ @@ -79,7 +127,7 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET], # if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) choke me # endif -#endif])], +#endif]])], [gl_cv_var_stdin_large_offset=yes], [gl_cv_var_stdin_large_offset=no])]) ]) diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4 index fe4ce12..b295f16 100644 --- a/gl/m4/stdlib_h.m4 +++ b/gl/m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 5 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# stdlib_h.m4 serial 15 +dnl Copyright (C) 2007-2009 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. @@ -8,6 +8,20 @@ AC_DEFUN([gl_STDLIB_H], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([stdlib.h]) + AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT]) + if test $ac_cv_header_random_h = yes; then + HAVE_RANDOM_H=1 + else + HAVE_RANDOM_H=0 + fi + AC_SUBST([HAVE_RANDOM_H]) + AC_CHECK_TYPES([struct random_data], + [], [HAVE_STRUCT_RANDOM_DATA=0], + [[#include + #if HAVE_RANDOM_H + # include + #endif + ]]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], @@ -22,21 +36,38 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) + GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) + GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) + GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) + GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) + GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) + GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) + GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) - HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) - HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) - HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) - HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) - HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) - HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV]) - REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) - REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) - VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV]) + HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) + HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) + HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) + HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) + HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) + HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) + HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) + HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) + HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) + HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) + HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) + 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_UNSETENV=1; AC_SUBST([HAVE_UNSETENV]) + HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) + REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) + REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) + VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV]) ]) diff --git a/gl/m4/strdup.m4 b/gl/m4/strdup.m4 index 8796e9e..d7daac2 100644 --- a/gl/m4/strdup.m4 +++ b/gl/m4/strdup.m4 @@ -1,7 +1,6 @@ -# strdup.m4 serial 9 +# strdup.m4 serial 11 -dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -10,8 +9,25 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRDUP], [ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_REPLACE_FUNCS(strdup) - AC_CHECK_DECLS_ONCE(strdup) + AC_REPLACE_FUNCS([strdup]) + AC_CHECK_DECLS_ONCE([strdup]) + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi + gl_PREREQ_STRDUP +]) + +AC_DEFUN([gl_FUNC_STRDUP_POSIX], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) + if test $gl_cv_func_malloc_posix != yes; then + REPLACE_STRDUP=1 + AC_LIBOBJ([strdup]) + else + AC_REPLACE_FUNCS([strdup]) + fi + AC_CHECK_DECLS_ONCE([strdup]) if test $ac_cv_have_decl_strdup = no; then HAVE_DECL_STRDUP=0 fi diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4 index eb7d45a..8c16ca9 100644 --- a/gl/m4/strerror.m4 +++ b/gl/m4/strerror.m4 @@ -1,5 +1,5 @@ -# strerror.m4 serial 7 -dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc. +# strerror.m4 serial 9 +dnl Copyright (C) 2002, 2007-2008 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. @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRERROR], [ AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE]) - if test $gl_cv_func_working_strerror = no; then + if test $REPLACE_STRERROR = 1; then AC_LIBOBJ([strerror]) AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR], [Define this to 1 if strerror is broken.]) @@ -18,25 +18,38 @@ AC_DEFUN([gl_FUNC_STRERROR], AC_DEFUN([gl_FUNC_STRERROR_SEPARATE], [ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_CACHE_CHECK([for working strerror function], - [gl_cv_func_working_strerror], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [#include - ], - [return !*strerror (-2);])], - [gl_cv_func_working_strerror=yes], - [gl_cv_func_working_strerror=no], - [dnl Assume crossbuild works if it compiles. - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [#include - ], - [return !*strerror (-2);])], - [gl_cv_func_working_strerror=yes], - [gl_cv_func_working_strerror=no])])]) - if test $gl_cv_func_working_strerror = no ; then + AC_REQUIRE([gl_HEADER_ERRNO_H]) + if test -z "$ERRNO_H"; then + AC_CACHE_CHECK([for working strerror function], + [gl_cv_func_working_strerror], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[return !*strerror (-2);]])], + [gl_cv_func_working_strerror=yes], + [gl_cv_func_working_strerror=no], + [dnl Assume crossbuild works if it compiles. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[return !*strerror (-2);]])], + [gl_cv_func_working_strerror=yes], + [gl_cv_func_working_strerror=no]) + ]) + ]) + if test $gl_cv_func_working_strerror = no; then + dnl The system's strerror() fails to return a string for out-of-range + dnl integers. Replace it. + REPLACE_STRERROR=1 + fi + else + dnl The system's strerror() cannot know about the new errno values we add + dnl to . Replace it. REPLACE_STRERROR=1 + fi + if test $REPLACE_STRERROR = 1; then gl_PREREQ_STRERROR fi ]) @@ -44,4 +57,12 @@ AC_DEFUN([gl_FUNC_STRERROR_SEPARATE], # Prerequisites of lib/strerror.c. AC_DEFUN([gl_PREREQ_STRERROR], [ AC_CHECK_DECLS([strerror]) + 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 ]) diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4 index 766d7e9..2d5553c 100644 --- a/gl/m4/string_h.m4 +++ b/gl/m4/string_h.m4 @@ -5,7 +5,7 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 6 # Written by Paul Eggert. @@ -35,6 +35,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) + GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) @@ -62,10 +63,12 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) + GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) 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]) @@ -79,9 +82,11 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR]) HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) + HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) + REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) + REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) + REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) + REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) - REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) - REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) - REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) ]) diff --git a/gl/m4/strndup.m4 b/gl/m4/strndup.m4 index f7934ef..4fa7d5a 100644 --- a/gl/m4/strndup.m4 +++ b/gl/m4/strndup.m4 @@ -1,5 +1,5 @@ -# strndup.m4 serial 14 -dnl Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc. +# strndup.m4 serial 16 +dnl Copyright (C) 2002-2003, 2005-2009 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. @@ -16,10 +16,10 @@ AC_DEFUN([gl_FUNC_STRNDUP], fi # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. - AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup, + AC_CACHE_CHECK([for working strndup], [gl_cv_func_strndup], [AC_RUN_IFELSE([ - AC_LANG_PROGRAM([#include - #include ], [[ + AC_LANG_PROGRAM([[#include + #include ]], [[ #ifndef HAVE_DECL_STRNDUP extern char *strndup (const char *, size_t); #endif @@ -40,7 +40,7 @@ AC_DEFUN([gl_FUNC_STRNDUP], [gl_cv_func_strndup=yes])], [gl_cv_func_strndup=no])])]) if test $gl_cv_func_strndup = yes; then - AC_DEFINE([HAVE_STRNDUP], 1, + AC_DEFINE([HAVE_STRNDUP], [1], [Define if you have the strndup() function and it works.]) else HAVE_STRNDUP=0 diff --git a/gl/m4/strnlen.m4 b/gl/m4/strnlen.m4 index d8307ed..1c97859 100644 --- a/gl/m4/strnlen.m4 +++ b/gl/m4/strnlen.m4 @@ -1,5 +1,5 @@ -# strnlen.m4 serial 9 -dnl Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc. +# strnlen.m4 serial 10 +dnl Copyright (C) 2002-2003, 2005-2007, 2009 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. @@ -20,8 +20,8 @@ AC_DEFUN([gl_FUNC_STRNLEN], # This is necessary because automake-1.6.1 doesn't understand # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. - #AC_LIBOBJ(strnlen) - AC_DEFINE(strnlen, rpl_strnlen, + #AC_LIBOBJ([strnlen]) + AC_DEFINE([strnlen], [rpl_strnlen], [Define to rpl_strnlen if the replacement function should be used.]) gl_PREREQ_STRNLEN fi diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4 index d9659c2..d1cb9c2 100644 --- a/gl/m4/sys_socket_h.m4 +++ b/gl/m4/sys_socket_h.m4 @@ -1,5 +1,5 @@ -# sys_socket_h.m4 serial 4 -dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. +# sys_socket_h.m4 serial 12 +dnl Copyright (C) 2005-2009 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. @@ -8,44 +8,133 @@ dnl From Simon Josefsson. AC_DEFUN([gl_HEADER_SYS_SOCKET], [ + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) + AC_REQUIRE([AC_C_INLINE]) + AC_CACHE_CHECK([whether is self-contained], [gl_cv_header_sys_socket_h_selfcontained], [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [])], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], [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 SYS_SOCKET_H='' - else - SYS_SOCKET_H='sys/socket.h' - - gl_CHECK_NEXT_HEADERS([sys/socket.h]) - if test $ac_cv_header_sys_socket_h = yes; then - HAVE_SYS_SOCKET_H=1 - HAVE_WINSOCK2_H=0 - HAVE_WS2TCPIP_H=0 - else - HAVE_SYS_SOCKET_H=0 - 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 ws2tcpip.h]) - if test $ac_cv_header_winsock2_h = yes; then - HAVE_WINSOCK2_H=1 - else - HAVE_WINSOCK2_H=0 - fi - if test $ac_cv_header_ws2tcpip_h = yes; then - HAVE_WS2TCPIP_H=1 - else - HAVE_WS2TCPIP_H=0 + dnl If the shutdown function exists, 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 defines the SHUT_* macros], + [gl_cv_header_sys_socket_h_shut], + [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[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 + SYS_SOCKET_H='sys/socket.h' fi fi - AC_SUBST([HAVE_SYS_SOCKET_H]) - AC_SUBST([HAVE_WINSOCK2_H]) - AC_SUBST([HAVE_WS2TCPIP_H]) + else + SYS_SOCKET_H='sys/socket.h' + fi + # We need to check for ws2tcpip.h now. + gl_PREREQ_SYS_H_SOCKET + AC_CHECK_TYPES([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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +]) + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + SYS_SOCKET_H='sys/socket.h' + fi + if test -n "$SYS_SOCKET_H"; then + gl_PREREQ_SYS_H_WINSOCK2 fi AC_SUBST([SYS_SOCKET_H]) ]) + +AC_DEFUN([gl_PREREQ_SYS_H_SOCKET], +[ + dnl Check prerequisites of the replacement. + gl_CHECK_NEXT_HEADERS([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + 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]) + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + AC_SUBST([HAVE_SYS_SOCKET_H]) + AC_SUBST([HAVE_WS2TCPIP_H]) +]) + +# Common prerequisites of of the replacement and of the +# 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]) +]) + +AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], +[ + GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET]) + GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT]) + GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT]) + GNULIB_BIND=0; AC_SUBST([GNULIB_BIND]) + GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME]) + GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME]) + GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT]) + GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN]) + GNULIB_RECV=0; AC_SUBST([GNULIB_RECV]) + GNULIB_SEND=0; AC_SUBST([GNULIB_SEND]) + GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM]) + GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO]) + GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) + GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) + HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) +]) diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4 new file mode 100644 index 0000000..d42a635 --- /dev/null +++ b/gl/m4/time_h.m4 @@ -0,0 +1,74 @@ +# Configure a more-standard replacement for . + +# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007 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 Jim Meyering. + +AC_DEFUN([gl_HEADER_TIME_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_TIME_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_TIME_H_BODY], +[ + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + gl_CHECK_NEXT_HEADERS([time.h]) + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) +]) + +AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], +[ + 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_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) + REPLACE_STRPTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRPTIME]) + REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) +]) + +dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared +dnl in time.h or sys/time.h. + +AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], +[ + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_CACHE_CHECK([for struct timespec in ], + [gl_cv_sys_struct_timespec_in_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[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 + 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 ], + [gl_cv_sys_struct_timespec_in_sys_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[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 + fi + fi + AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) +]) diff --git a/gl/m4/time_r.m4 b/gl/m4/time_r.m4 new file mode 100644 index 0000000..c871b56 --- /dev/null +++ b/gl/m4/time_r.m4 @@ -0,0 +1,43 @@ +dnl Reentrant time functions like localtime_r. + +dnl Copyright (C) 2003, 2006, 2007, 2008 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 to declare localtime_r. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) + + AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature], + [gl_cv_time_r_posix], + [AC_TRY_COMPILE( + [#include ], + [/* 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 + AC_LIBOBJ([time_r]) + gl_PREREQ_TIME_R + 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..be323c9 --- /dev/null +++ b/gl/m4/timegm.m4 @@ -0,0 +1,40 @@ +# timegm.m4 serial 6 +dnl Copyright (C) 2003, 2007, 2009 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_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_MKTIME]) + if test $ac_cv_func_working_mktime = no; then + # Assume that timegm is buggy if mktime is. + AC_LIBOBJ([timegm]) + ac_cv_func_timegm=no + else + AC_REPLACE_FUNCS([timegm]) + fi + REPLACE_TIMEGM=1 + if test $ac_cv_func_timegm = yes; then + AC_CHECK_DECLS([timegm], [REPLACE_TIMEGM=0], [], [#include ]) + fi + if test $REPLACE_TIMEGM = 1; then + gl_PREREQ_TIMEGM + fi +]) + +# Prerequisites of lib/timegm.c. +AC_DEFUN([gl_PREREQ_TIMEGM], [ + AC_REQUIRE([gl_TIME_R]) + AC_REQUIRE([gl_FUNC_MKTIME]) + if test $ac_cv_func_working_mktime = yes; then + AC_CHECK_FUNC([__mktime_internal], , + [# mktime works but it doesn't export __mktime_internal, + # so we need to substitute our own mktime implementation. + AC_LIBOBJ([mktime]) + AC_DEFINE([mktime], [rpl_mktime], + [Define to rpl_mktime if the replacement function should be used.]) + gl_PREREQ_MKTIME]) + fi +]) diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4 index 4b8857c..ff9a4ea 100644 --- a/gl/m4/unistd_h.m4 +++ b/gl/m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 10 -dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +# unistd_h.m4 serial 17 +dnl Copyright (C) 2006-2009 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. @@ -32,30 +32,52 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ - GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) - GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) - GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) - GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) - GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) - GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) - GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) - GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) - GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) - GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) - GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) + GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) + GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) + GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) + HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_GETDOMAINNAME=1; AC_SUBST([HAVE_GETDOMAINNAME]) + HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) + HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) + HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) + HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) + REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) + REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) + UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) ]) diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4 index c4d3f4f..3a1d1e0 100644 --- a/gl/m4/vasnprintf.m4 +++ b/gl/m4/vasnprintf.m4 @@ -1,12 +1,11 @@ -# vasnprintf.m4 serial 24 -dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc. +# vasnprintf.m4 serial 29 +dnl Copyright (C) 2002-2004, 2006-2009 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_REQUIRE([gl_EOVERFLOW]) AC_CHECK_FUNCS_ONCE([vasnprintf]) if test $ac_cv_func_vasnprintf = no; then gl_REPLACE_VASNPRINTF @@ -21,7 +20,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF], AC_LIBOBJ([printf-parse]) AC_LIBOBJ([asnprintf]) if test $ac_cv_func_vasnprintf = yes; then - AC_DEFINE([REPLACE_VASNPRINTF], 1, + AC_DEFINE([REPLACE_VASNPRINTF], [1], [Define if vasnprintf exists but is overridden by gnulib.]) fi gl_PREREQ_PRINTF_ARGS @@ -53,13 +52,13 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE], ]) # Prerequisites of lib/vasnprintf.c. -AC_DEFUN([gl_PREREQ_VASNPRINTF], +AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], [ AC_REQUIRE([AC_FUNC_ALLOCA]) AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) - AC_CHECK_FUNCS(snprintf wcslen) + 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 ]) @@ -67,14 +66,14 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF], # Extra prerequisites of lib/vasnprintf.c for supporting 'long double' # arguments. -AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], +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, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -90,7 +89,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'double' arguments.]) ;; @@ -111,7 +110,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'long double' arguments.]) ;; @@ -128,7 +127,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1, + 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]) @@ -144,13 +143,28 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1, + 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], [ @@ -159,7 +173,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1, + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], [Define if the vasnprintf implementation needs special code for the ' flag.]) ;; @@ -174,7 +188,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1, + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], [Define if the vasnprintf implementation needs special code for the '-' flag.]) ;; @@ -189,7 +203,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1, + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], [Define if the vasnprintf implementation needs special code for the 0 flag.]) ;; @@ -204,13 +218,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1, + 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, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -226,13 +240,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_ENOMEM], 1, + 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, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -248,6 +262,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS], 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 diff --git a/gl/m4/vsnprintf.m4 b/gl/m4/vsnprintf.m4 index accc79f..3b37d46 100644 --- a/gl/m4/vsnprintf.m4 +++ b/gl/m4/vsnprintf.m4 @@ -1,5 +1,5 @@ -# vsnprintf.m4 serial 4 -dnl Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. +# vsnprintf.m4 serial 5 +dnl Copyright (C) 2002-2004, 2007-2008 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. @@ -7,8 +7,17 @@ dnl with or without modifications, as long as this notice is preserved. 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 = no; then + if test $ac_cv_func_vsnprintf = yes; then + gl_SNPRINTF_SIZE1 + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_cv_func_vsnprintf_usable=yes + ;; + esac + fi + if test $gl_cv_func_vsnprintf_usable = no; then gl_REPLACE_VSNPRINTF fi AC_CHECK_DECLS_ONCE([vsnprintf]) diff --git a/gl/m4/wchar.m4 b/gl/m4/wchar.m4 index 70b1248..2e52a82 100644 --- a/gl/m4/wchar.m4 +++ b/gl/m4/wchar.m4 @@ -1,13 +1,13 @@ dnl A placeholder for ISO C99 , for platforms that have issues. -dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2009 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.m4 serial 4 +# wchar.m4 serial 23 AC_DEFUN([gl_WCHAR_H], [ @@ -18,7 +18,16 @@ AC_DEFUN([gl_WCHAR_H], wchar_t w;]], [gl_cv_header_wchar_h_standalone=yes], [gl_cv_header_wchar_h_standalone=no])]) - if test $gl_cv_header_wchar_h_standalone != yes; then + + 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]) + + if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then WCHAR_H=wchar.h fi @@ -36,6 +45,13 @@ wchar_t w;]], gl_CHECK_NEXT_HEADERS([wchar.h]) ]) +dnl Unconditionally enables the replacement of . +AC_DEFUN([gl_REPLACE_WCHAR_H], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + WCHAR_H=wchar.h +]) + AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. @@ -45,10 +61,40 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], AC_DEFUN([gl_WCHAR_H_DEFAULTS], [ - GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) + GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) + GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) + GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) + GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) + GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) + GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) + GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) + GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) + GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) + GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) + GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) - REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) - WCHAR_H= - AC_SUBST([WCHAR_H]) + 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_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) + 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]) + WCHAR_H=''; AC_SUBST([WCHAR_H]) ]) diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4 index cde2129..fb27a7f 100644 --- a/gl/m4/wchar_t.m4 +++ b/gl/m4/wchar_t.m4 @@ -1,5 +1,5 @@ -# wchar_t.m4 serial 1 (gettext-0.12) -dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +# wchar_t.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2002-2003, 2008, 2009 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. @@ -10,11 +10,11 @@ dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ - AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, + AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], [AC_TRY_COMPILE([#include wchar_t foo = (wchar_t)'\0';], , - gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) + [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.]) + 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..cb7d926 --- /dev/null +++ b/gl/m4/wcrtomb.m4 @@ -0,0 +1,92 @@ +# wcrtomb.m4 serial 4 +dnl Copyright (C) 2008-2009 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 + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + fi + AC_CHECK_FUNCS_ONCE([wcrtomb]) + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + fi + if test $HAVE_WCRTOMB != 0 && test $REPLACE_WCRTOMB != 1; then + dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes + dnl 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 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 and Solaris. + aix4* | osf* | solaris*) 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_TRY_RUN([ +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + return 0; +}], + [gl_cv_func_wcrtomb_retval=yes], + [gl_cv_func_wcrtomb_retval=no], + [:]) + fi + ]) + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([wcrtomb]) + gl_PREREQ_WCRTOMB + fi +]) + +# Prerequisites of lib/wcrtomb.c. +AC_DEFUN([gl_PREREQ_WCRTOMB], [ + : +]) diff --git a/gl/m4/wctype.m4 b/gl/m4/wctype.m4 index 7483c4f..6a1b6f0 100644 --- a/gl/m4/wctype.m4 +++ b/gl/m4/wctype.m4 @@ -1,6 +1,8 @@ +# wctype.m4 serial 2 + dnl A placeholder for ISO C99 , for platforms that lack it. -dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2008 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. @@ -9,6 +11,7 @@ dnl Written by Paul Eggert. AC_DEFUN([gl_WCTYPE_H], [ + AC_REQUIRE([AC_PROG_CC]) AC_CHECK_FUNCS_ONCE([iswcntrl]) if test $ac_cv_func_iswcntrl = yes; then HAVE_ISWCNTRL=1 @@ -30,7 +33,27 @@ AC_DEFUN([gl_WCTYPE_H], WCTYPE_H=wctype.h if test $ac_cv_header_wctype_h = yes; then if test $ac_cv_func_iswcntrl = yes; then - WCTYPE_H= + 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_TRY_RUN([#include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; }], + [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], + [AC_TRY_COMPILE([#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif], [], + [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no]) + ]) + ]) + if test $gl_cv_func_iswcntrl_works = yes; then + WCTYPE_H= + fi fi dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty, dnl for the benefit of builds from non-distclean directories. @@ -41,4 +64,11 @@ AC_DEFUN([gl_WCTYPE_H], fi AC_SUBST([HAVE_WCTYPE_H]) AC_SUBST([WCTYPE_H]) + + if test "$gl_cv_func_iswcntrl_works" = no; then + REPLACE_ISWCNTRL=1 + else + REPLACE_ISWCNTRL=0 + fi + AC_SUBST([REPLACE_ISWCNTRL]) ]) diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4 index af5ed93..47a4363 100644 --- a/gl/m4/wint_t.m4 +++ b/gl/m4/wint_t.m4 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 2 (gettext-0.17) -dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. +# wint_t.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 2003, 2007-2009 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. @@ -10,7 +10,7 @@ dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ - AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, + AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], [AC_TRY_COMPILE([ /* Tru64 with Desktop Toolkit C has a bug: must be included before . @@ -21,8 +21,8 @@ AC_DEFUN([gt_TYPE_WINT_T], #include #include wint_t foo = (wchar_t)'\0';], , - gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) + [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.]) + AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) fi ]) diff --git a/gl/m4/write.m4 b/gl/m4/write.m4 new file mode 100644 index 0000000..812b19b --- /dev/null +++ b/gl/m4/write.m4 @@ -0,0 +1,20 @@ +# write.m4 serial 1 +dnl Copyright (C) 2008 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_WRITE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + dnl This ifdef is just an optimization, to avoid performing a configure + dnl check whose result is not used. It does not make the test of + dnl GNULIB_UNISTD_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_WRITE=1 + AC_LIBOBJ([write]) + fi + ]) +]) diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4 index 85bb721..631893c 100644 --- a/gl/m4/xsize.m4 +++ b/gl/m4/xsize.m4 @@ -1,5 +1,5 @@ -# xsize.m4 serial 3 -dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. +# xsize.m4 serial 4 +dnl Copyright (C) 2003-2004, 2008 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. @@ -9,5 +9,5 @@ AC_DEFUN([gl_XSIZE], dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) - AC_CHECK_HEADERS(stdint.h) + AC_CHECK_HEADERS([stdint.h]) ]) diff --git a/gl/math.in.h b/gl/math.in.h index c3515d7..a0efefd 100644 --- a/gl/math.in.h +++ b/gl/math.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2002-2003, 2007 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2007-2009 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 @@ -17,8 +17,12 @@ #ifndef _GL_MATH_H +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + /* The include_next requires a split double-inclusion guard. */ -#@INCLUDE_NEXT@ @NEXT_MATH_H@ +#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_MATH_H@ #ifndef _GL_MATH_H #define _GL_MATH_H @@ -32,6 +36,34 @@ extern "C" { #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@ +# undef NAN + /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ +# ifdef __DECC +static float +_NaN () +{ + static float zero = 0.0f; + return zero / zero; +} +# define NAN (_NaN()) +# else +# define NAN (0.0f / 0.0f) +# endif +#endif + +/* Solaris 10 defines HUGE_VAL, but as a function pointer rather + than a floating point constant. */ +#if @REPLACE_HUGE_VAL@ +# undef HUGE_VAL +# define HUGE_VAL (1.0 / 0.0) +#endif + /* Write x as x = mantissa * 2^exp where @@ -323,7 +355,8 @@ extern double trunc (double x); #endif #if @GNULIB_TRUNCL@ -# if !@HAVE_DECL_TRUNCL@ +# if @REPLACE_TRUNCL@ +# undef truncl # define truncl rpl_truncl extern long double truncl (long double x); # endif @@ -352,6 +385,124 @@ extern int gl_isfinitel (long double x); #endif +#if @GNULIB_ISINF@ +# if @REPLACE_ISINF@ +extern int gl_isinff (float x); +extern int gl_isinfd (double x); +extern 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 +#elif defined GNULIB_POSIXCHECK + /* How to override a macro? */ +#endif + + +#if @GNULIB_ISNANF@ +/* Test for NaN for 'float' numbers. */ +# if @HAVE_ISNANF@ +/* The original included above provides a declaration of isnan macro + or (older) isnanf function. */ +# include +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnanf +# define isnanf(x) __builtin_isnanf ((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 +extern 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 included above provides a declaration of isnan macro. */ +# include +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins 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 +extern int isnand (double x); +# endif +#endif + +#if @GNULIB_ISNANL@ +/* Test for NaN for 'long double' numbers. */ +# if @HAVE_ISNANL@ +/* The original included above provides a declaration of isnan macro or (older) isnanl function. */ +# include +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnanl +# define isnanl(x) __builtin_isnanl ((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 +extern int isnanl (long double x); +# 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 +# define gl_isnan_f(x) __builtin_isnan ((float)(x)) +# else +extern int rpl_isnanf (float x); +# define gl_isnan_f(x) rpl_isnanf (x) +# endif +# if @HAVE_ISNAND@ && __GNUC__ >= 4 +# define gl_isnan_d(x) __builtin_isnan ((double)(x)) +# else +extern int rpl_isnand (double x); +# define gl_isnan_d(x) rpl_isnand (x) +# endif +# if @HAVE_ISNANL@ && __GNUC__ >= 4 +# define gl_isnan_l(x) __builtin_isnan ((long double)(x)) +# else +extern int rpl_isnanl (long double x); +# 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)) +# endif +#elif defined GNULIB_POSIXCHECK + /* How to override a macro? */ +#endif + + #if @GNULIB_SIGNBIT@ # if @REPLACE_SIGNBIT_USING_GCC@ # undef signbit @@ -367,7 +518,8 @@ extern int gl_signbitf (float arg); extern int gl_signbitd (double arg); extern int gl_signbitl (long double arg); # if __GNUC__ >= 2 && !__STRICT_ANSI__ -# if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT +# 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[(sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \ @@ -376,7 +528,8 @@ extern int gl_signbitl (long double arg); (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \ }) # endif -# if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT +# 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[(sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \ @@ -385,7 +538,8 @@ extern int gl_signbitl (long double arg); (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \ }) # endif -# if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT +# 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[(sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \ diff --git a/gl/mbrtowc.c b/gl/mbrtowc.c new file mode 100644 index 0000000..0fec5f1 --- /dev/null +++ b/gl/mbrtowc.c @@ -0,0 +1,386 @@ +/* Convert multibyte character to wide character. + Copyright (C) 1999-2002, 2005-2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + 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 . */ + +#include + +/* Specification. */ +#include + +#if GNULIB_defined_mbstate_t +/* Implement mbrtowc() on top of mbtowc(). */ + +# include +# include + +# include "localcharset.h" +# include "streq.h" +# include "verify.h" + + +verify (sizeof (mbstate_t) >= 4); + +static char internal_state[4]; + +size_t +mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) +{ + char *pstate = (char *)ps; + + if (pstate == NULL) + pstate = internal_state; + + if (s == NULL) + { + pwc = NULL; + s = ""; + n = 1; + } + + if (n == 0) + return (size_t)(-2); + + /* Here n > 0. */ + { + size_t nstate = pstate[0]; + char buf[4]; + const char *p; + size_t m; + + 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. */ + +# if __GLIBC__ + /* Work around bug */ + mbtowc (NULL, NULL, 0); +# endif + { + int res = mbtowc (pwc, p, m); + + if (res >= 0) + { + if (pwc != NULL && ((*pwc == 0) != (res == 0))) + abort (); + if (nstate >= (res > 0 ? res : 1)) + abort (); + res -= nstate; + pstate[0] = 0; + return res; + } + + /* 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. + Use specialized code for each. */ + if (m >= 4 || m >= MB_CUR_MAX) + goto invalid; + /* Here MB_CUR_MAX > 1 and 0 < m < 4. */ + { + const char *encoding = locale_charset (); + + if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0)) + { + /* Cf. unistr/u8-mblen.c. */ + unsigned char c = (unsigned char) p[0]; + + if (c >= 0xc2) + { + if (c < 0xe0) + { + if (m == 1) + goto incomplete; + } + else if (c < 0xf0) + { + if (m == 1) + goto incomplete; + if (m == 2) + { + unsigned char c2 = (unsigned char) p[1]; + + if ((c2 ^ 0x80) < 0x40 + && (c >= 0xe1 || c2 >= 0xa0) + && (c != 0xed || c2 < 0xa0)) + goto incomplete; + } + } + else if (c <= 0xf4) + { + if (m == 1) + goto incomplete; + else /* m == 2 || m == 3 */ + { + 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 /* m == 3 */ + { + unsigned char c3 = (unsigned char) p[2]; + + if ((c3 ^ 0x80) < 0x40) + goto incomplete; + } + } + } + } + } + goto invalid; + } + + /* As a reference for this code, you can use the GNU libiconv + implementation. Look for uses of the RET_TOOFEW macro. */ + + if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)) + { + 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; + } + if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) + || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if (c >= 0xa1 && c < 0xff) + goto incomplete; + } + goto invalid; + } + if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)) + { + 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; + } + if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0)) + { + 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; + } + if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0)) + { + 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; + } + + /* An unknown multibyte encoding. */ + goto incomplete; + } + + 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); + } + } +} + +#else +/* Override the system's mbrtowc() function. */ + +# undef mbrtowc + +size_t +rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) +{ +# if MBRTOWC_NULL_ARG_BUG || MBRTOWC_RETVAL_BUG + if (s == NULL) + { + pwc = NULL; + s = ""; + n = 1; + } +# endif + +# if MBRTOWC_RETVAL_BUG + { + static mbstate_t internal_state; + + /* Override mbrtowc's internal state. We can not 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--) + { + wchar_t wc; + size_t 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. */ + if (pwc != NULL) + *pwc = wc; + return (wc == 0 ? 0 : count); + } + } + return (size_t)(-2); + } + } +# endif + +# if MBRTOWC_NUL_RETVAL_BUG + { + wchar_t wc; + size_t ret = mbrtowc (&wc, s, n, ps); + + if (ret != (size_t)(-1) && ret != (size_t)(-2)) + { + if (pwc != NULL) + *pwc = wc; + if (wc == 0) + ret = 0; + } + return ret; + } +# else + return mbrtowc (pwc, s, n, ps); +# endif +} + +#endif diff --git a/gl/mbsinit.c b/gl/mbsinit.c new file mode 100644 index 0000000..81fed5a --- /dev/null +++ b/gl/mbsinit.c @@ -0,0 +1,47 @@ +/* Test for initial conversion state. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + 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 . */ + +#include + +/* Specification. */ +#include + +#include "verify.h" + +/* 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. + - In wc -> mb direction, mbstate_t contains no information. In other + words, it is always in the initial state. */ + +verify (sizeof (mbstate_t) >= 4); + +int +mbsinit (const mbstate_t *ps) +{ + const char *pstate = (const char *)ps; + + return pstate[0] == 0; +} diff --git a/gl/mktime.c b/gl/mktime.c new file mode 100644 index 0000000..0f30d43 --- /dev/null +++ b/gl/mktime.c @@ -0,0 +1,665 @@ +/* Convert a `struct tm' to a time_t value. + Copyright (C) 1993-1999, 2002-2005, 2006, 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Paul Eggert . + + 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, 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 02110-1301, USA. */ + +/* Define this to have a standalone program to test this implementation of + mktime. */ +/* #define DEBUG 1 */ + +#ifndef _LIBC +# include +#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 + +#include + +#include /* For the real memcpy prototype. */ + +#if DEBUG +# include +# include +/* Make it work even if the system's libc has its own mktime routine. */ +# define mktime my_mktime +#endif /* DEBUG */ + +/* Shift A right by B bits portably, by dividing A by 2**B and + truncating towards minus infinity. A and B should be free of side + effects, and B should be in the range 0 <= B <= INT_BITS - 2, where + INT_BITS is the number of useful bits in an int. GNU code can + assume that 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. */ +#define SHR(a, b) \ + (-1 >> 1 == -1 \ + ? (a) >> (b) \ + : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0)) + +/* 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 negative values of the signed integer type T use two's + complement, ones' complement, or signed magnitude representation, + respectively. Much GNU code assumes two's complement, but some + people like to be portable to all possible C hosts. */ +#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) +#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) +#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) + +/* True if the arithmetic type T is signed. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* The maximum and minimum values for the integer type T. These + macros have undefined behavior if T is signed and has padding bits. + If this is a problem for you, please let us know how to fix it for + your host. */ +#define TYPE_MINIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) 0 \ + : TYPE_SIGNED_MAGNITUDE (t) \ + ? ~ (t) 0 \ + : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) +#define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ + : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) + +#ifndef TIME_T_MIN +# define TIME_T_MIN TYPE_MINIMUM (time_t) +#endif +#ifndef TIME_T_MAX +# define TIME_T_MAX TYPE_MAXIMUM (time_t) +#endif +#define TIME_T_MIDPOINT (SHR (TIME_T_MIN + TIME_T_MAX, 1) + 1) + +/* Verify a requirement at compile-time (unlike assert, which is runtime). */ +#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; } + +verify (time_t_is_integer, TYPE_IS_INTEGER (time_t)); +verify (twos_complement_arithmetic, TYPE_TWOS_COMPLEMENT (int)); +/* The code also assumes that signed integer overflow silently wraps + around, but this assumption can't be stated without causing a + diagnostic on some hosts. */ + +#define EPOCH_YEAR 1970 +#define TM_YEAR_BASE 1900 +verify (base_year_is_a_multiple_of_100, TM_YEAR_BASE % 100 == 0); + +/* Return 1 if YEAR + TM_YEAR_BASE is a leap year. */ +static inline int +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 } + }; + + +#ifndef _LIBC +/* Portable standalone applications should supply a that + declares a POSIX-compliant localtime_r, for the benefit of older + implementations that lack localtime_r or have a nonstandard one. + See the gnulib time_r module for one way to implement this. */ +# undef __localtime_r +# define __localtime_r localtime_r +# define __mktime_internal mktime_internal +#endif + +/* 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 time stamps. + + The YEAR values uses the same numbering as TP->tm_year. Values + need not be in the usual range. However, YEAR1 must not be less + than 2 * INT_MIN or greater than 2 * INT_MAX. + + The result may overflow. It is the caller's responsibility to + detect overflow. */ + +static inline time_t +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 (C99_integer_division, -1 / 2 == 0); + verify (long_int_year_and_yday_are_wide_enough, + INT_MAX <= LONG_MAX / 2 || TIME_T_MAX <= UINT_MAX); + + /* 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 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 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 in time_t precision. Overflow might + occur here. */ + time_t tyear1 = year1; + time_t years = tyear1 - year0; + time_t days = 365 * years + yday1 - yday0 + intervening_leap_days; + time_t hours = 24 * days + hour1 - hour0; + time_t minutes = 60 * hours + min1 - min0; + time_t seconds = 60 * minutes + sec1 - sec0; + return seconds; +} + + +/* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC), + assuming that *T corresponds to *TP and that no clock adjustments + occurred between *TP and the desired time. + If TP is null, return a value not equal to *T; this avoids false matches. + If overflow occurs, yield the minimal or maximal value, except do not + yield a value equal to *T. */ +static time_t +guess_time_tm (long int year, long int yday, int hour, int min, int sec, + const time_t *t, const struct tm *tp) +{ + if (tp) + { + time_t d = ydhms_diff (year, yday, hour, min, sec, + tp->tm_year, tp->tm_yday, + tp->tm_hour, tp->tm_min, tp->tm_sec); + time_t t1 = *t + d; + if ((t1 < *t) == (TYPE_SIGNED (time_t) ? d < 0 : TIME_T_MAX / 2 < d)) + return t1; + } + + /* Overflow occurred one way or another. Return the nearest result + that is actually in range, except don't report a zero difference + if the actual difference is nonzero, as that would cause a false + match; and don't oscillate between two values, as that would + confuse the spring-forward gap detector. */ + return (*t < TIME_T_MIDPOINT + ? (*t <= TIME_T_MIN + 1 ? *t + 1 : TIME_T_MIN) + : (TIME_T_MAX - 1 <= *t ? *t - 1 : TIME_T_MAX)); +} + +/* 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. */ +static struct tm * +ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), + time_t *t, struct tm *tp) +{ + struct tm *r = convert (t, tp); + + if (!r && *t) + { + time_t bad = *t; + time_t ok = 0; + + /* BAD is a known unconvertible time_t, and OK is a known good one. + Use binary search to narrow the range between BAD and OK until + they differ by 1. */ + while (bad != ok + (bad < 0 ? -1 : 1)) + { + time_t mid = *t = (bad < 0 + ? bad + ((ok - bad) >> 1) + : ok + ((bad - ok) >> 1)); + r = convert (t, tp); + if (r) + ok = mid; + else + bad = mid; + } + + if (!r && ok) + { + /* The last conversion attempt failed; + revert to the most recent successful attempt. */ + *t = ok; + r = convert (t, tp); + } + } + + return r; +} + + +/* Convert *TP to a time_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. + This function is external because it is used also by timegm.c. */ +time_t +__mktime_internal (struct tm *tp, + struct tm *(*convert) (const time_t *, struct tm *), + time_t *offset) +{ + time_t t, gt, t0, t1, t2; + 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; + /* Normalize the value. */ + int isdst = ((tp->tm_isdst >> (8 * sizeof (tp->tm_isdst) - 1)) + | (tp->tm_isdst != 0)); + + /* 1 if the previous probe was DST. */ + int dst2; + + /* 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 minor overflows correctly, + assuming int and time_t arithmetic wraps around. + Major overflows are caught at the end. */ + + /* 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; + + time_t guessed_offset = *offset; + + int sec_requested = sec; + + if (LEAP_SECONDS_POSSIBLE) + { + /* Handle out-of-range seconds specially, + since ydhms_tm_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. */ + + t0 = ydhms_diff (year, yday, hour, min, sec, + EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, - guessed_offset); + + if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3) + { + /* time_t isn't large enough to rule out overflows, so check + for major overflows. A gross check suffices, since if t0 + has overflowed, it is off by a multiple of TIME_T_MAX - + TIME_T_MIN + 1. So ignore any component of the difference + that is bounded by a small value. */ + + /* Approximate log base 2 of the number of time units per + biennium. A biennium is 2 years; use this unit instead of + years to avoid integer overflow. For example, 2 average + Gregorian years are 2 * 365.2425 * 24 * 60 * 60 seconds, + which is 63113904 seconds, and rint (log2 (63113904)) is + 26. */ + int ALOG2_SECONDS_PER_BIENNIUM = 26; + int ALOG2_MINUTES_PER_BIENNIUM = 20; + int ALOG2_HOURS_PER_BIENNIUM = 14; + int ALOG2_DAYS_PER_BIENNIUM = 10; + int LOG2_YEARS_PER_BIENNIUM = 1; + + int approx_requested_biennia = + (SHR (year_requested, LOG2_YEARS_PER_BIENNIUM) + - SHR (EPOCH_YEAR - TM_YEAR_BASE, LOG2_YEARS_PER_BIENNIUM) + + SHR (mday, ALOG2_DAYS_PER_BIENNIUM) + + SHR (hour, ALOG2_HOURS_PER_BIENNIUM) + + SHR (min, ALOG2_MINUTES_PER_BIENNIUM) + + (LEAP_SECONDS_POSSIBLE + ? 0 + : SHR (sec, ALOG2_SECONDS_PER_BIENNIUM))); + + int approx_biennia = SHR (t0, ALOG2_SECONDS_PER_BIENNIUM); + int diff = approx_biennia - approx_requested_biennia; + int abs_diff = diff < 0 ? - diff : diff; + + /* IRIX 4.0.5 cc miscaculates TIME_T_MIN / 3: it erroneously + gives a positive value of 715827882. Setting a variable + first then doing math on it seems to work. + (ghazi@caip.rutgers.edu) */ + time_t time_t_max = TIME_T_MAX; + time_t time_t_min = TIME_T_MIN; + time_t overflow_threshold = + (time_t_max / 3 - time_t_min / 3) >> ALOG2_SECONDS_PER_BIENNIUM; + + if (overflow_threshold < abs_diff) + { + /* Overflow occurred. Try repairing it; this might work if + the time zone offset is enough to undo the overflow. */ + time_t repaired_t0 = -1 - t0; + approx_biennia = SHR (repaired_t0, ALOG2_SECONDS_PER_BIENNIUM); + diff = approx_biennia - approx_requested_biennia; + abs_diff = diff < 0 ? - diff : diff; + if (overflow_threshold < abs_diff) + return -1; + guessed_offset += repaired_t0 - t0; + t0 = repaired_t0; + } + } + + /* Repeatedly use the error to improve the guess. */ + + for (t = t1 = t2 = t0, dst2 = 0; + (gt = guess_time_tm (year, yday, hour, min, sec, &t, + ranged_convert (convert, &t, &tm)), + t != gt); + t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0) + 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 GT - T. Follow the common + practice in this case, which is to return a time that is GT - T + 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; + else if (--remaining_probes == 0) + return -1; + + /* We have a match. Check whether tm.tm_isdst has the requested + value, if any. */ + if (isdst != tm.tm_isdst && 0 <= isdst && 0 <= 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. This should work for all real + time zone histories in the tz database. */ + + /* 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; + + /* The longest period of DST in tzdata2003a is 536454000 seconds + (e.g., America/Jujuy starting 1946-10-01 01:00). The longest + period of non-DST is much longer, but it makes no real sense + to search for more than a year of non-DST, so use the DST + max. */ + int duration_max = 536454000; + + /* 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) + { + time_t ot = t + delta * direction; + if ((ot < t) == (direction < 0)) + { + struct tm otm; + ranged_convert (convert, &ot, &otm); + if (otm.tm_isdst == isdst) + { + /* We found the desired tm_isdst. + Extrapolate back to the desired time. */ + t = guess_time_tm (year, yday, hour, min, sec, &ot, &otm); + ranged_convert (convert, &t, &tm); + goto offset_found; + } + } + } + } + + offset_found: + *offset = guessed_offset + t - t0; + + 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. */ + int sec_adjustment = (sec == 0 && tm.tm_sec == 60) - sec; + t1 = t + sec_requested; + t2 = t1 + sec_adjustment; + if (((t1 < t) != (sec_requested < 0)) + | ((t2 < t1) != (sec_adjustment < 0)) + | ! convert (&t2, &tm)) + return -1; + t = t2; + } + + *tp = tm; + return t; +} + + +/* FIXME: This should use a signed type wide enough to hold any UTC + offset in seconds. 'int' should be good enough for GNU code. We + can't fix this unilaterally though, as other modules invoke + __mktime_internal. */ +static time_t localtime_offset; + +/* Convert *TP to a time_t value. */ +time_t +mktime (struct tm *tp) +{ +#ifdef _LIBC + /* 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 (); +#endif + + return __mktime_internal (tp, __localtime_r, &localtime_offset); +} + +#ifdef weak_alias +weak_alias (mktime, timelocal) +#endif + +#ifdef _LIBC +libc_hidden_def (mktime) +libc_hidden_weak (timelocal) +#endif + +#if DEBUG + +static int +not_equal_tm (const struct tm *a, const struct tm *b) +{ + return ((a->tm_sec ^ b->tm_sec) + | (a->tm_min ^ b->tm_min) + | (a->tm_hour ^ b->tm_hour) + | (a->tm_mday ^ b->tm_mday) + | (a->tm_mon ^ b->tm_mon) + | (a->tm_year ^ b->tm_year) + | (a->tm_yday ^ b->tm_yday) + | (a->tm_isdst ^ b->tm_isdst)); +} + +static void +print_tm (const struct tm *tp) +{ + if (tp) + printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", + tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec, + tp->tm_yday, tp->tm_wday, tp->tm_isdst); + else + printf ("0"); +} + +static int +check_result (time_t tk, struct tm tmk, time_t tl, const struct tm *lt) +{ + if (tk != tl || !lt || not_equal_tm (&tmk, lt)) + { + printf ("mktime ("); + print_tm (lt); + printf (")\nyields ("); + print_tm (&tmk); + printf (") == %ld, should be %ld\n", (long int) tk, (long int) tl); + return 1; + } + + return 0; +} + +int +main (int argc, char **argv) +{ + int status = 0; + struct tm tm, tmk, tml; + struct tm *lt; + time_t tk, tl, tl1; + char trailer; + + if ((argc == 3 || argc == 4) + && (sscanf (argv[1], "%d-%d-%d%c", + &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) + == 3) + && (sscanf (argv[2], "%d:%d:%d%c", + &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) + == 3)) + { + tm.tm_year -= TM_YEAR_BASE; + tm.tm_mon--; + tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); + tmk = tm; + tl = mktime (&tmk); + lt = localtime (&tl); + if (lt) + { + tml = *lt; + lt = &tml; + } + printf ("mktime returns %ld == ", (long int) tl); + print_tm (&tmk); + printf ("\n"); + status = check_result (tl, tmk, tl, lt); + } + else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) + { + time_t from = atol (argv[1]); + time_t by = atol (argv[2]); + time_t to = atol (argv[3]); + + if (argc == 4) + for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) + { + lt = localtime (&tl); + if (lt) + { + tmk = tml = *lt; + tk = mktime (&tmk); + status |= check_result (tk, tmk, tl, &tml); + } + else + { + printf ("localtime (%ld) yields 0\n", (long int) tl); + status = 1; + } + tl1 = tl + by; + if ((tl1 < tl) != (by < 0)) + break; + } + else + for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) + { + /* Null benchmark. */ + lt = localtime (&tl); + if (lt) + { + tmk = tml = *lt; + tk = tl; + status |= check_result (tk, tmk, tl, &tml); + } + else + { + printf ("localtime (%ld) yields 0\n", (long int) tl); + status = 1; + } + tl1 = tl + by; + if ((tl1 < tl) != (by < 0)) + break; + } + } + else + printf ("Usage:\ +\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ +\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ +\t%s FROM BY TO - # Do not test those values (for benchmark).\n", + argv[0], argv[0], argv[0]); + + return status; +} + +#endif /* DEBUG */ + +/* +Local Variables: +compile-command: "gcc -DDEBUG -Wall -W -O -g mktime.c -o mktime" +End: +*/ diff --git a/gl/mountlist.c b/gl/mountlist.c index 4c975c6..50e90ee 100644 --- a/gl/mountlist.c +++ b/gl/mountlist.c @@ -1,7 +1,6 @@ /* mountlist.c -- return a list of mounted file systems - Copyright (C) 1991, 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 1991, 1992, 1997-2009 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 @@ -24,6 +23,7 @@ #include #include #include +#include #include "xalloc.h" @@ -134,10 +134,6 @@ # include "unlocked-io.h" #endif -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - /* The results of open() in this file are not used with fchdir, therefore save some unnecessary work in fchdir.c. */ #undef open @@ -300,7 +296,6 @@ fstype_to_string (int t) /* 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) { @@ -327,7 +322,7 @@ dev_from_mount_options (char const *mount_options) } # endif - + (void) mount_options; return -1; } @@ -344,6 +339,7 @@ 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_LISTMNTENT { @@ -378,7 +374,7 @@ read_file_system_list (bool need_fs_type) #ifdef MOUNTED_GETMNTENT1 /* GNU/Linux, 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ { struct mntent *mnt; - char *table = MOUNTED; + char const *table = MOUNTED; FILE *fp; fp = setmntent (table, "r"); diff --git a/gl/netdb.in.h b/gl/netdb.in.h new file mode 100644 index 0000000..363206d --- /dev/null +++ b/gl/netdb.in.h @@ -0,0 +1,182 @@ +/* Provide a netdb.h header file for systems lacking it (read: MinGW). + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Simon Josefsson. + + 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, 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 02110-1301, USA. */ + +/* This file is supposed to be used on platforms that lack . + It is intended to provide definitions and prototypes needed by an + application. */ + +#ifndef _GL_NETDB_H + +#if @HAVE_NETDB_H@ + +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_NETDB_H@ + +#endif + +#ifndef _GL_NETDB_H +#define _GL_NETDB_H + +/* Get netdb.h definitions such as struct hostent for MinGW. */ +#include + +/* Declarations for a platform that lacks , or where it is + incomplete. */ + +#if @GNULIB_GETADDRINFO@ + +# if !@HAVE_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. */ +}; +# 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 +/* The commented out definitions below are not yet implemented in the + GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact, + cause conflicts on systems with a getaddrinfo() function which does not + define them. + + If they are restored, be sure to protect the definitions with #ifndef. */ +# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ +# define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ +# define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ +# define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose + returned address type.. */ +# endif /* 0 */ + +/* 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 + +# if !@HAVE_DECL_GETADDRINFO@ +/* Translate name of a service location and/or a service name to set of + socket addresses. + For more details, see the POSIX:2001 specification + . */ +extern int getaddrinfo (const char *restrict nodename, + const char *restrict servname, + const struct addrinfo *restrict hints, + struct addrinfo **restrict res); +# endif + +# if !@HAVE_DECL_FREEADDRINFO@ +/* Free `addrinfo' structure AI including associated storage. + For more details, see the POSIX:2001 specification + . */ +extern void freeaddrinfo (struct addrinfo *ai); +# endif + +# if !@HAVE_DECL_GAI_STRERROR@ +/* Convert error return from getaddrinfo() to a string. + For more details, see the POSIX:2001 specification + . */ +extern const char *gai_strerror (int ecode); +# endif + +# if !@HAVE_DECL_GETNAMEINFO@ +/* Convert socket address to printable node and service names. + For more details, see the POSIX:2001 specification + . */ +extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, + char *restrict node, socklen_t nodelen, + char *restrict service, socklen_t servicelen, + int flags); +# endif + +/* Possible flags for getnameinfo. */ +# ifndef NI_NUMERICHOST +# define NI_NUMERICHOST 1 +# endif +# ifndef NI_NUMERICSERV +# define NI_NUMERICSERV 2 +# endif + +#endif /* @GNULIB_GETADDRINFO@ */ + +#endif /* _GL_NETDB_H */ +#endif /* _GL_NETDB_H */ diff --git a/gl/netinet_in.in.h b/gl/netinet_in.in.h index c45e53b..97e11a7 100644 --- a/gl/netinet_in.in.h +++ b/gl/netinet_in.in.h @@ -1,5 +1,5 @@ /* Substitute for . - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 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 @@ -19,6 +19,10 @@ #if @HAVE_NETINET_IN_H@ +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif + /* On many platforms, assumes prior inclusion of . */ # include diff --git a/gl/open-safer.c b/gl/open-safer.c index ce493d5..15bf6a6 100644 --- a/gl/open-safer.c +++ b/gl/open-safer.c @@ -1,6 +1,6 @@ /* Invoke open, but avoid some glitches. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008 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 @@ -38,9 +38,10 @@ open_safer (char const *file, int flags, ...) /* Assume mode_t promotes to int if and only if it is smaller. This assumption isn't guaranteed by the C standard, but we don't know of any real-world counterexamples. */ - mode = (sizeof (mode_t) < sizeof (int) - ? va_arg (ap, int) - : va_arg (ap, mode_t)); + if (sizeof (mode_t) < sizeof (int)) + mode = va_arg (ap, int); + else + mode = va_arg (ap, mode_t); va_end (ap); } diff --git a/gl/open.c b/gl/open.c new file mode 100644 index 0000000..13af274 --- /dev/null +++ b/gl/open.c @@ -0,0 +1,140 @@ +/* Open a descriptor to a file. + Copyright (C) 2007-2008 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 . */ + +/* Written by Bruno Haible , 2007. */ + +#include + +/* Get the original definition of open. It might be defined as a macro. */ +#define __need_system_fcntl_h +#include +#undef __need_system_fcntl_h +#include + +static inline int +orig_open (const char *filename, int flags, mode_t mode) +{ + return open (filename, flags, mode); +} + +/* Specification. */ +#include + +#include +#include +#include +#include +#include + +int +open (const char *filename, int flags, ...) +{ + mode_t mode; + int fd; + + mode = 0; + if (flags & O_CREAT) + { + va_list arg; + va_start (arg, flags); + + /* If mode_t is narrower than int, use the promoted type (int), + not mode_t. Use sizeof to guess whether mode_t is narrower; + we don't know of any practical counterexamples. */ + mode = (sizeof (mode_t) < sizeof (int) + ? va_arg (arg, int) + : va_arg (arg, mode_t)); + + va_end (arg); + } + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + if (strcmp (filename, "/dev/null") == 0) + filename = "NUL"; +#endif + +#if OPEN_TRAILING_SLASH_BUG + /* If the filename ends in a slash and one of O_CREAT, O_WRONLY, O_RDWR + is specified, then fail. + Rationale: POSIX + says that + "A pathname that contains at least one non-slash character and that + ends with one or more trailing slashes shall be resolved as if a + single dot character ( '.' ) were appended to the pathname." + and + "The special filename dot shall refer to the directory specified by + its predecessor." + 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 + 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 | O_WRONLY | O_RDWR)) + { + size_t len = strlen (filename); + if (len > 0 && filename[len - 1] == '/') + { + errno = EISDIR; + return -1; + } + } +#endif + + fd = orig_open (filename, flags, mode); + +#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 that + "A pathname that contains at least one non-slash character and that + ends with one or more trailing slashes shall be resolved as if a + single dot character ( '.' ) were appended to the pathname." + and + "The special filename dot shall refer to the directory specified by + its predecessor." + If the named file without the slash is not a directory, open() must fail + with ENOTDIR. */ + if (fd >= 0) + { + size_t len = strlen (filename); + if (len > 0 && filename[len - 1] == '/') + { + struct stat statbuf; + + if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode)) + { + close (fd); + errno = ENOTDIR; + return -1; + } + } + } +#endif + +#ifdef FCHDIR_REPLACEMENT + if (fd >= 0) + _gl_register_fd (fd, filename); +#endif + + return fd; +} diff --git a/gl/regcomp.c b/gl/regcomp.c index 8827e03..b114b4d 100644 --- a/gl/regcomp.c +++ b/gl/regcomp.c @@ -1,5 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. + Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -333,8 +334,8 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, && 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 + 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]); @@ -356,45 +357,65 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, #ifdef RE_ENABLE_I18N else if (type == COMPLEX_BRACKET) { - Idx i; re_charset_t *cset = dfa->nodes[node].opr.mbcset; - if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes - || cset->nranges || cset->nchar_classes) - { + Idx i; + # ifdef _LIBC - if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0) + /* 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)) { - /* In this case we want to catch the bytes which are - the first byte of any 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'. */ 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); } -# else - if (dfa->mb_cur_max > 1) - for (i = 0; i < SBC_MAX; ++i) - if (__btowc (i) == WEOF) - re_set_fastmap (fastmap, icase, i); -# endif /* not _LIBC */ - } - for (i = 0; i < cset->nmbchars; ++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 +# ifdef _LIBC + || cset->nequiv_classes +# endif /* _LIBC */ + )) { - 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) + unsigned char c = 0; + do { - if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state) - != (size_t) -1) - re_set_fastmap (fastmap, false, *(unsigned char *) buf); + 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); + } } } } @@ -776,7 +797,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length, __libc_lock_init (dfa->lock); err = re_string_construct (®exp, pattern, length, preg->translate, - syntax & RE_ICASE, dfa); + (syntax & RE_ICASE) != 0, dfa); if (BE (err != REG_NOERROR, 0)) { re_compile_internal_free_return: @@ -1057,7 +1078,9 @@ optimize_utf8 (re_dfa_t *dfa) case BUF_LAST: break; default: - /* Word anchors etc. cannot be handled. */ + /* 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; @@ -1344,6 +1367,8 @@ calc_first (void *extra, bin_tree_t *node) node->node_idx = re_dfa_add_node (dfa, node->token); if (BE (node->node_idx == REG_MISSING, 0)) return REG_ESPACE; + if (node->token.type == ANCHOR) + dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type; } return REG_NOERROR; } @@ -1473,21 +1498,18 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, destination. */ org_dest = dfa->edests[org_node].elems[0]; re_node_set_empty (dfa->edests + clone_node); - if (dfa->nodes[org_node].type == ANCHOR) + clone_dest = search_duplicated_node (dfa, org_dest, constraint); + /* 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) { - /* In case of the node has another constraint, append it. */ - if (org_node == root_node && clone_node != org_node) - { - /* ...but if the node is root_node itself, it means the - epsilon closure have a loop, then tie it to the - destination of the root_node. */ - ok = re_node_set_insert (dfa->edests + clone_node, org_dest); - if (BE (! ok, 0)) - return REG_ESPACE; - break; - } - constraint |= dfa->nodes[org_node].opr.ctx_type; + ok = re_node_set_insert (dfa->edests + clone_node, org_dest); + if (BE (! ok, 0)) + 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 (BE (clone_dest == REG_MISSING, 0)) return REG_ESPACE; @@ -1505,7 +1527,7 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, clone_dest = search_duplicated_node (dfa, org_dest, constraint); if (clone_dest == REG_MISSING) { - /* There are no such a duplicated node, create a new one. */ + /* There is no such duplicated node, create a new one. */ reg_errcode_t err; clone_dest = duplicate_node (dfa, org_dest, constraint); if (BE (clone_dest == REG_MISSING, 0)) @@ -1520,7 +1542,7 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, } else { - /* There are a duplicated node which satisfy the constraint, + /* There is a duplicated node which satisfy the constraint, use it to avoid infinite loop. */ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); if (BE (! ok, 0)) @@ -1569,8 +1591,7 @@ duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint) if (BE (dup_idx != REG_MISSING, 1)) { dfa->nodes[dup_idx].constraint = constraint; - if (dfa->nodes[org_idx].type == ANCHOR) - dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].opr.ctx_type; + dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].constraint; dfa->nodes[dup_idx].duplicated = 1; /* Store the index of the original node. */ @@ -1652,7 +1673,6 @@ static reg_errcode_t calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) { reg_errcode_t err; - unsigned int constraint; Idx i; bool incomplete; bool ok; @@ -1666,15 +1686,14 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) We reference this value to avoid infinite loop. */ dfa->eclosures[node].nelem = REG_MISSING; - constraint = ((dfa->nodes[node].type == ANCHOR) - ? dfa->nodes[node].opr.ctx_type : 0); - /* If the current node has constraints, duplicate all nodes. - Since they must inherit the constraints. */ - if (constraint + /* 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, constraint); + err = duplicate_node_closure (dfa, node, node, node, + dfa->nodes[node].constraint); if (BE (err != REG_NOERROR, 0)) return err; } diff --git a/gl/regex_internal.c b/gl/regex_internal.c index cf3bf1b..7acec79 100644 --- a/gl/regex_internal.c +++ b/gl/regex_internal.c @@ -1,6 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software - Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -236,7 +236,7 @@ build_wcs_buffer (re_string_t *pstr) } else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx; - mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); if (BE (mbclen == (size_t) -2, 0)) { /* The buffer doesn't have enough space, finish to build. */ @@ -306,9 +306,9 @@ build_wcs_upper_buffer (re_string_t *pstr) 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); + mbclen = __mbrtowc (&wc, + ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx + + byte_idx), remain_len, &pstr->cur_state); if (BE (mbclen < (size_t) -2, 1)) { wchar_t wcu = wc; @@ -376,7 +376,7 @@ build_wcs_upper_buffer (re_string_t *pstr) } else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx; - mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); if (BE (mbclen < (size_t) -2, 1)) { wchar_t wcu = wc; @@ -499,8 +499,8 @@ re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc) Idx remain_len; remain_len = pstr->len - rawbuf_idx; prev_st = pstr->cur_state; - mbclen = mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, - remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, + remain_len, &pstr->cur_state); if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0)) { /* We treat these cases as a single byte character. */ @@ -687,10 +687,10 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) } else { +#ifdef RE_ENABLE_I18N /* No, skip all characters until IDX. */ Idx prev_valid_len = pstr->valid_len; -#ifdef RE_ENABLE_I18N if (BE (pstr->offsets_needed, 0)) { pstr->len = pstr->raw_len - idx + offset; @@ -745,8 +745,8 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) /* 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 *) p, mlen, - &cur_state); + mbclen = __mbrtowc (&wc2, (const char *) p, mlen, + &cur_state); if (raw + offset - p <= mbclen && mbclen < (size_t) -2) { @@ -1689,11 +1689,9 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, for (i = 0 ; i < nodes->nelem ; i++) { - unsigned int constraint = 0; re_token_t *node = dfa->nodes + nodes->elems[i]; re_token_type_t type = node->type; - if (node->constraint) - constraint = node->constraint; + unsigned int constraint = node->constraint; if (type == CHARACTER && !constraint) continue; @@ -1706,8 +1704,6 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, newstate->halt = 1; else if (type == OP_BACK_REF) newstate->has_backref = 1; - else if (type == ANCHOR) - constraint = node->opr.ctx_type; if (constraint) { diff --git a/gl/regex_internal.h b/gl/regex_internal.h index f96291d..dc322ec 100644 --- a/gl/regex_internal.h +++ b/gl/regex_internal.h @@ -1,5 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -84,7 +85,7 @@ # define SIZE_MAX ((size_t) -1) #endif -#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC +#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCSCOLL) || _LIBC # define RE_ENABLE_I18N #endif @@ -115,6 +116,7 @@ # define __iswctype iswctype # define __btowc btowc # define __wcrtomb wcrtomb +# define __mbrtowc mbrtowc # define __regfree regfree # define attribute_hidden #endif /* not _LIBC */ @@ -161,9 +163,9 @@ typedef unsigned long int bitset_word_t; instead, deduce it directly from BITSET_WORD_MAX. Avoid greater-than-32-bit integers and unconditional shifts by more than 31 bits, as they're not portable. */ -#if BITSET_WORD_MAX == 0xffffffff +#if BITSET_WORD_MAX == 0xffffffffUL # define BITSET_WORD_BITS 32 -#elif BITSET_WORD_MAX >> 31 >> 5 == 1 +#elif BITSET_WORD_MAX >> 31 >> 4 == 1 # define BITSET_WORD_BITS 36 #elif BITSET_WORD_MAX >> 31 >> 16 == 1 # define BITSET_WORD_BITS 48 @@ -182,10 +184,6 @@ typedef unsigned long int bitset_word_t; # if BITSET_WORD_BITS <= SBC_MAX # error "Invalid SBC_MAX" # endif -#elif BITSET_WORD_MAX == (0xffffffff + 2) * 0xffffffff -/* Work around a bug in 64-bit PGC (before version 6.1-2), where the - preprocessor mishandles large unsigned values as if they were signed. */ -# define BITSET_WORD_BITS 64 #else # error "Add case for new bitset_word_t size" #endif @@ -421,7 +419,7 @@ struct re_dfa_t; typedef struct re_dfa_t re_dfa_t; #ifndef _LIBC -# ifdef __i386__ +# if defined __i386__ && !defined __EMX__ # define internal_function __attribute ((regparm (3), stdcall)) # else # define internal_function diff --git a/gl/regexec.c b/gl/regexec.c index ac6c258..5452ef7 100644 --- a/gl/regexec.c +++ b/gl/regexec.c @@ -1,6 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, - Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -701,7 +701,8 @@ re_search_internal (const regex_t *preg, 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, dfa); + preg->translate, (preg->syntax & RE_ICASE) != 0, + dfa); if (BE (err != REG_NOERROR, 0)) goto free_return; mctx.input.stop = stop; @@ -1044,6 +1045,11 @@ prune_impossible_nodes (re_match_context_t *mctx) re_node_set_free (&sctx.limits); if (BE (ret != REG_NOERROR, 0)) goto free_return; + if (sifted_states[0] == NULL) + { + ret = REG_NOMATCH; + goto free_return; + } } re_free (mctx->state_log); mctx->state_log = sifted_states; @@ -3078,7 +3084,9 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx, const re_dfa_t *const dfa = mctx->dfa; bool ok; Idx cur_idx; +#ifdef RE_ENABLE_I18N reg_errcode_t err = REG_NOERROR; +#endif re_node_set union_set; re_node_set_init_empty (&union_set); for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx) @@ -3467,7 +3475,7 @@ out_free: CONTEXT_NEWLINE); if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0)) goto out_free; - } + } else { dest_states_word[i] = dest_states[i]; diff --git a/gl/snprintf.c b/gl/snprintf.c index 960cfdb..dafbda8 100644 --- a/gl/snprintf.c +++ b/gl/snprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc. Written by Simon Josefsson and Paul Eggert. This program is free software; you can redistribute it and/or modify @@ -29,11 +29,6 @@ #include "vasnprintf.h" -/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ -#ifndef EOVERFLOW -# define EOVERFLOW E2BIG -#endif - /* 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). diff --git a/gl/stdbool.in.h b/gl/stdbool.in.h index 171d70a..cffa0ab 100644 --- a/gl/stdbool.in.h +++ b/gl/stdbool.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ /* BeOS already #defines false 0, true 1. We use the same definitions below, but temporarily we have to #undef them. */ -#ifdef __BEOS__ +#if defined __BEOS__ && !defined __HAIKU__ # include /* defines bool but not _Bool */ # undef false # undef true @@ -73,7 +73,7 @@ (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the enum; this ensures that '_Bool' promotes to 'int'. */ -#if defined __cplusplus || defined __BEOS__ +#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__) /* A compiler known to have 'bool'. */ /* If the compiler already has both 'bool' and '_Bool', we can assume they are the same types. */ diff --git a/gl/stdint.in.h b/gl/stdint.in.h index 67baceb..53aa34a 100644 --- a/gl/stdint.in.h +++ b/gl/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -49,6 +49,9 @@ in would reinclude us, skipping our contents because _GL_STDINT_H is defined. The include_next requires a split double-inclusion guard. */ +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif # @INCLUDE_NEXT@ @NEXT_STDINT_H@ #endif @@ -86,15 +89,6 @@ # include #endif -#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS - -/* Get WCHAR_MIN, WCHAR_MAX. */ -# if ! (defined WCHAR_MIN && defined WCHAR_MAX) -# include -# endif - -#endif - #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* Minimum and maximum values for a integer type under the usual assumption. @@ -119,46 +113,58 @@ #undef int8_t #undef uint8_t -#define int8_t signed char -#define uint8_t unsigned char +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 -#define int16_t short int -#define uint16_t unsigned short int +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 -#define int32_t int -#define uint32_t unsigned int +typedef int gl_int32_t; +typedef unsigned int gl_uint32_t; +#define int32_t gl_int32_t +#define uint32_t gl_uint32_t /* 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 -# define int64_t long int +typedef long int gl_int64_t; +# define int64_t gl_int64_t # define GL_INT64_T #elif defined _MSC_VER # undef int64_t -# define int64_t __int64 +typedef __int64 gl_int64_t; +# define int64_t gl_int64_t # define GL_INT64_T #elif @HAVE_LONG_LONG_INT@ # undef int64_t -# define int64_t long long int +typedef long long int gl_int64_t; +# define int64_t gl_int64_t # define GL_INT64_T #endif #if ULONG_MAX >> 31 >> 31 >> 1 == 1 # undef uint64_t -# define uint64_t unsigned long int +typedef unsigned long int gl_uint64_t; +# define uint64_t gl_uint64_t # define GL_UINT64_T #elif defined _MSC_VER # undef uint64_t -# define uint64_t unsigned __int64 +typedef unsigned __int64 gl_uint64_t; +# define uint64_t gl_uint64_t # define GL_UINT64_T #elif @HAVE_UNSIGNED_LONG_LONG_INT@ # undef uint64_t -# define uint64_t unsigned long long int +typedef unsigned long long int gl_uint64_t; +# define uint64_t gl_uint64_t # define GL_UINT64_T #endif @@ -213,12 +219,18 @@ #undef uint_fast32_t #undef int_fast64_t #undef uint_fast64_t -#define int_fast8_t long int -#define uint_fast8_t unsigned int_fast8_t -#define int_fast16_t long int -#define uint_fast16_t unsigned int_fast16_t -#define int_fast32_t long int -#define uint_fast32_t unsigned int_fast32_t +typedef long int gl_int_fast8_t; +typedef unsigned long int gl_uint_fast8_t; +typedef long int gl_int_fast16_t; +typedef unsigned long int gl_uint_fast16_t; +typedef long int gl_int_fast32_t; +typedef unsigned long int gl_uint_fast32_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 @@ -230,8 +242,10 @@ #undef intptr_t #undef uintptr_t -#define intptr_t long int -#define uintptr_t unsigned long int +typedef long int gl_intptr_t; +typedef unsigned long int gl_uintptr_t; +#define intptr_t gl_intptr_t +#define uintptr_t gl_uintptr_t /* 7.18.1.5. Greatest-width integer types */ @@ -240,20 +254,24 @@ #undef intmax_t #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define intmax_t long long int +typedef long long int gl_intmax_t; +# define intmax_t gl_intmax_t #elif defined GL_INT64_T # define intmax_t int64_t #else -# define intmax_t long int +typedef long int gl_intmax_t; +# define intmax_t gl_intmax_t #endif #undef uintmax_t #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define uintmax_t unsigned long long int +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 -# define uintmax_t unsigned long int +typedef unsigned long int gl_uintmax_t; +# define uintmax_t gl_uintmax_t #endif /* Verify that intmax_t and uintmax_t have the same size. Too much code @@ -416,10 +434,20 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - /* ptrdiff_t limits */ #undef PTRDIFF_MIN #undef PTRDIFF_MAX -#define PTRDIFF_MIN \ - _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -#define PTRDIFF_MAX \ - _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +#if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) +# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# else +# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) +# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) +# endif +#else +# define PTRDIFF_MIN \ + _STDINT_MIN (1, @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 @@ -434,9 +462,26 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - /* size_t limit */ #undef SIZE_MAX -#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) +#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 -> -> -> , and the latter includes + and assumes its types are already defined. */ +#if ! (defined WCHAR_MIN && defined WCHAR_MAX) +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# include +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +#endif #undef WCHAR_MIN #undef WCHAR_MAX #define WCHAR_MIN \ diff --git a/gl/stdio-write.c b/gl/stdio-write.c new file mode 100644 index 0000000..f1d0fcb --- /dev/null +++ b/gl/stdio-write.c @@ -0,0 +1,148 @@ +/* POSIX compatible FILE stream write function. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + 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 . */ + +#include + +/* Specification. */ +#include + +/* Replace these functions only if module 'sigpipe' is requested. */ +#if 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 __WIN32__) && ! defined __CYGWIN__ + +# include +# include +# include + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include + +# define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \ + if (ferror (stream)) \ + return (EXPRESSION); \ + else \ + { \ + RETTYPE ret; \ + SetLastError (0); \ + ret = (EXPRESSION); \ + if (FAILED && 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; \ + } \ + } \ + 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_VFPRINTF_POSIX /* avoid collision with vprintf.c */ +int +vprintf (const char *format, va_list args) +{ + return vfprintf (stdout, format, args); +} +# endif + +# if !REPLACE_VPRINTF_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 index 434fa8e..cb273d7 100644 --- a/gl/stdio.in.h +++ b/gl/stdio.in.h @@ -16,6 +16,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + #if defined __need_FILE || defined __need___FILE /* Special invocation convention inside glibc header files. */ @@ -71,6 +75,10 @@ extern "C" { extern int fprintf (FILE *fp, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); # endif +#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# define fprintf rpl_fprintf +extern int fprintf (FILE *fp, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); #elif defined GNULIB_POSIXCHECK # undef fprintf # define fprintf \ @@ -86,6 +94,10 @@ extern int fprintf (FILE *fp, const char *format, ...) extern int vfprintf (FILE *fp, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 2, 0))); # endif +#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# define vfprintf rpl_vfprintf +extern int vfprintf (FILE *fp, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); #elif defined GNULIB_POSIXCHECK # undef vfprintf # define vfprintf(s,f,a) \ @@ -102,6 +114,11 @@ extern int vfprintf (FILE *fp, const char *format, va_list args) extern int printf (const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); # endif +#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +/* Don't break __attribute__((format(printf,M,N))). */ +# define printf __printf__ +extern int printf (const char *format, ...) + __attribute__ ((__format__ (__printf__, 1, 2))); #elif defined GNULIB_POSIXCHECK # undef printf # define printf \ @@ -124,6 +141,10 @@ extern int printf (const char *format, ...) extern int vprintf (const char *format, va_list args) __attribute__ ((__format__ (__printf__, 1, 0))); # endif +#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# define vprintf rpl_vprintf +extern int vprintf (const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 1, 0))); #elif defined GNULIB_POSIXCHECK # undef vprintf # define vprintf(f,a) \ @@ -195,6 +216,38 @@ extern int vsprintf (char *str, const char *format, va_list args) vsprintf (b, f, a)) #endif +#if @GNULIB_DPRINTF@ +# if @REPLACE_DPRINTF@ +# define dprintf rpl_dprintf +# endif +# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@ +extern int dprintf (int fd, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dprintf +# define dprintf(d,f,a) \ + (GL_LINK_WARNING ("dprintf is unportable - " \ + "use gnulib module dprintf for portability"), \ + dprintf (d, f, a)) +#endif + +#if @GNULIB_VDPRINTF@ +# if @REPLACE_VDPRINTF@ +# define vdprintf rpl_vdprintf +# endif +# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@ +extern int vdprintf (int fd, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vdprintf +# define vdprintf(d,f,a) \ + (GL_LINK_WARNING ("vdprintf is unportable - " \ + "use gnulib module vdprintf for portability"), \ + vdprintf (d, f, a)) +#endif + #if @GNULIB_VASPRINTF@ # if @REPLACE_VASPRINTF@ # define asprintf rpl_asprintf @@ -212,8 +265,29 @@ extern int vsprintf (char *str, const char *format, va_list args) # endif #endif +#if @GNULIB_OBSTACK_PRINTF@ +# if @REPLACE_OBSTACK_PRINTF@ +# define obstack_printf rpl_osbtack_printf +# define obstack_vprintf rpl_obstack_vprintf +# endif +# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@ + 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. */ + extern int obstack_printf (struct obstack *obs, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); + extern int obstack_vprintf (struct obstack *obs, const char *format, + va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#endif + #if @GNULIB_FOPEN@ # if @REPLACE_FOPEN@ +# undef fopen # define fopen rpl_fopen extern FILE * fopen (const char *filename, const char *mode); # endif @@ -227,6 +301,7 @@ extern FILE * fopen (const char *filename, const char *mode); #if @GNULIB_FREOPEN@ # if @REPLACE_FREOPEN@ +# undef freopen # define freopen rpl_freopen extern FILE * freopen (const char *filename, const char *mode, FILE *stream); # endif @@ -332,6 +407,57 @@ extern long rpl_ftell (FILE *fp); fflush (f)) #endif +#if @GNULIB_FCLOSE@ +# if @REPLACE_FCLOSE@ +# define fclose rpl_fclose + /* Close STREAM and its underlying file descriptor. */ +extern int fclose (FILE *stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fclose +# define fclose(f) \ + (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \ + "use gnulib module fclose for portable " \ + "POSIX compliance"), \ + fclose (f)) +#endif + +#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef fputc +# define fputc rpl_fputc +extern int fputc (int c, FILE *stream); +#endif + +#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef putc +# define putc rpl_fputc +extern int putc (int c, FILE *stream); +#endif + +#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef putchar +# define putchar rpl_putchar +extern int putchar (int c); +#endif + +#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef fputs +# define fputs rpl_fputs +extern int fputs (const char *string, FILE *stream); +#endif + +#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef puts +# define puts rpl_puts +extern int puts (const char *string); +#endif + +#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef fwrite +# define fwrite rpl_fwrite +extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream); +#endif + #if @GNULIB_GETDELIM@ # if !@HAVE_DECL_GETDELIM@ /* Read input, up to (and including) the next occurrence of DELIMITER, from @@ -373,6 +499,22 @@ extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream); getline (l, s, f)) #endif +#if @GNULIB_PERROR@ +# if @REPLACE_PERROR@ +# define perror rpl_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. */ +extern void perror (const char *string); +# endif +#elif defined GNULIB_POSIXCHECK +# undef perror +# define perror(s) \ + (GL_LINK_WARNING ("perror is not always POSIX compliant - " \ + "use gnulib module perror for portability"), \ + perror (s)) +#endif + #ifdef __cplusplus } #endif diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h index 100ff52..f99767f 100644 --- a/gl/stdlib.in.h +++ b/gl/stdlib.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995, 2001-2004, 2006-2007 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2009 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 @@ -15,6 +15,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + #if defined __need_malloc_and_calloc /* Special invocation convention inside glibc header files. */ @@ -32,6 +36,34 @@ #define _GL_STDLIB_H +/* Solaris declares getloadavg() in . */ +#if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@ +# include +#endif + +/* OSF/1 5.1 declares 'struct random_data' in , which is included + from if _REENTRANT is defined. Include it always. */ +#if @HAVE_RANDOM_H@ +# include +#endif + +#if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@ +# include +#endif + +#if !@HAVE_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. */ +}; +#endif + /* The definition of GL_LINK_WARNING is copied here. */ @@ -99,6 +131,38 @@ extern void * calloc (size_t nmemb, size_t size); #endif +#if @GNULIB_ATOLL@ +# if !@HAVE_ATOLL@ +/* Parse a signed decimal integer. + Returns the value of the integer. Errors are not detected. */ +extern long long atoll (const char *string); +# endif +#elif defined GNULIB_POSIXCHECK +# undef atoll +# define atoll(s) \ + (GL_LINK_WARNING ("atoll is unportable - " \ + "use gnulib module atoll for portability"), \ + atoll (s)) +#endif + + +#if @GNULIB_GETLOADAVG@ +# if !@HAVE_DECL_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. */ +extern int getloadavg (double loadavg[], int nelem); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getloadavg +# define getloadavg(l,n) \ + (GL_LINK_WARNING ("getloadavg is not portable - " \ + "use gnulib module getloadavg for portability"), \ + getloadavg (l, n)) +#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. @@ -176,6 +240,58 @@ extern int putenv (char *string); #endif +#if @GNULIB_RANDOM_R@ +# if !@HAVE_RANDOM_R@ + +# ifndef RAND_MAX +# define RAND_MAX 2147483647 +# endif + +int srandom_r (unsigned int seed, struct random_data *rand_state); +int initstate_r (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state); +int setstate_r (char *arg_state, struct random_data *rand_state); +int random_r (struct random_data *buf, int32_t *result); +# endif +#elif defined GNULIB_POSIXCHECK +# undef random_r +# define random_r(b,r) \ + (GL_LINK_WARNING ("random_r is unportable - " \ + "use gnulib module random_r for portability"), \ + random_r (b,r)) +# undef initstate_r +# define initstate_r(s,b,sz,r) \ + (GL_LINK_WARNING ("initstate_r is unportable - " \ + "use gnulib module random_r for portability"), \ + initstate_r (s,b,sz,r)) +# undef srandom_r +# define srandom_r(s,r) \ + (GL_LINK_WARNING ("srandom_r is unportable - " \ + "use gnulib module random_r for portability"), \ + srandom_r (s,r)) +# undef setstate_r +# define setstate_r(a,r) \ + (GL_LINK_WARNING ("setstate_r is unportable - " \ + "use gnulib module random_r for portability"), \ + setstate_r (a,r)) +#endif + + +#if @GNULIB_RPMATCH@ +# if !@HAVE_RPMATCH@ +/* Test a user response to a question. + Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ +extern int rpmatch (const char *response); +# endif +#elif defined GNULIB_POSIXCHECK +# undef rpmatch +# define rpmatch(r) \ + (GL_LINK_WARNING ("rpmatch is unportable - " \ + "use gnulib module rpmatch for portability"), \ + rpmatch (r)) +#endif + + #if @GNULIB_SETENV@ # if !@HAVE_SETENV@ /* Set NAME to VALUE in the environment. @@ -199,6 +315,65 @@ extern int unsetenv (const char *name); #endif +#if @GNULIB_STRTOD@ +# if @REPLACE_STRTOD@ +# define strtod rpl_strtod +# endif +# if !@HAVE_STRTOD@ || @REPLACE_STRTOD@ + /* Parse a double from STRING, updating ENDP if appropriate. */ +extern double strtod (const char *str, char **endp); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtod +# define strtod(s, e) \ + (GL_LINK_WARNING ("strtod is unportable - " \ + "use gnulib module strtod for portability"), \ + strtod (s, e)) +#endif + + +#if @GNULIB_STRTOLL@ +# if !@HAVE_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. */ +extern long long strtoll (const char *string, char **endptr, int base); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtoll +# define strtoll(s,e,b) \ + (GL_LINK_WARNING ("strtoll is unportable - " \ + "use gnulib module strtoll for portability"), \ + strtoll (s, e, b)) +#endif + + +#if @GNULIB_STRTOULL@ +# if !@HAVE_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. */ +extern unsigned long long strtoull (const char *string, char **endptr, int base); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtoull +# define strtoull(s,e,b) \ + (GL_LINK_WARNING ("strtoull is unportable - " \ + "use gnulib module strtoull for portability"), \ + strtoull (s, e, b)) +#endif + + #ifdef __cplusplus } #endif diff --git a/gl/streq.h b/gl/streq.h new file mode 100644 index 0000000..80df916 --- /dev/null +++ b/gl/streq.h @@ -0,0 +1,176 @@ +/* Optimized string comparison. + Copyright (C) 2001-2002, 2007 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 + Lesser 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 . */ + +/* Written by Bruno Haible . */ + +#ifndef _GL_STREQ_H +#define _GL_STREQ_H + +#include + +/* STREQ allows to optimize string comparison with a small literal string. + STREQ (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 (__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(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(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.c b/gl/strerror.c index 9fe437d..798d854 100644 --- a/gl/strerror.c +++ b/gl/strerror.c @@ -1,6 +1,6 @@ /* strerror.c --- POSIX compatible system error routine - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2009 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 @@ -21,8 +21,15 @@ #if REPLACE_STRERROR +# include # include +# if GNULIB_defined_ESOCK /* native Windows platforms */ +# if HAVE_WINSOCK2_H +# include +# endif +# endif + # include "intprops.h" # undef strerror @@ -33,17 +40,302 @@ char * rpl_strerror (int n) { - char *result = strerror (n); - - if (result == NULL || result[0] == '\0') + char const *msg = NULL; + /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */ + switch (n) { - static char const fmt[] = "Unknown error (%d)"; - static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)]; - sprintf (mesg, fmt, n); - return mesg; +# if GNULIB_defined_ETXTBSY + case ETXTBSY: + msg = "Text file busy"; + break; +# endif + +# if GNULIB_defined_ESOCK /* native Windows platforms */ + /* EWOULDBLOCK is the same as EAGAIN. */ + case EINPROGRESS: + msg = "Operation now in progress"; + break; + case EALREADY: + msg = "Operation already in progress"; + break; + case ENOTSOCK: + msg = "Socket operation on non-socket"; + break; + case EDESTADDRREQ: + msg = "Destination address required"; + break; + case EMSGSIZE: + msg = "Message too long"; + break; + case EPROTOTYPE: + msg = "Protocol wrong type for socket"; + break; + case ENOPROTOOPT: + msg = "Protocol not available"; + break; + case EPROTONOSUPPORT: + msg = "Protocol not supported"; + break; + case ESOCKTNOSUPPORT: + msg = "Socket type not supported"; + break; + case EOPNOTSUPP: + msg = "Operation not supported"; + break; + case EPFNOSUPPORT: + msg = "Protocol family not supported"; + break; + case EAFNOSUPPORT: + msg = "Address family not supported by protocol"; + break; + case EADDRINUSE: + msg = "Address already in use"; + break; + case EADDRNOTAVAIL: + msg = "Cannot assign requested address"; + break; + case ENETDOWN: + msg = "Network is down"; + break; + case ENETUNREACH: + msg = "Network is unreachable"; + break; + case ENETRESET: + msg = "Network dropped connection on reset"; + break; + case ECONNABORTED: + msg = "Software caused connection abort"; + break; + case ECONNRESET: + msg = "Connection reset by peer"; + break; + case ENOBUFS: + msg = "No buffer space available"; + break; + case EISCONN: + msg = "Transport endpoint is already connected"; + break; + case ENOTCONN: + msg = "Transport endpoint is not connected"; + break; + case ESHUTDOWN: + msg = "Cannot send after transport endpoint shutdown"; + break; + case ETOOMANYREFS: + msg = "Too many references: cannot splice"; + break; + case ETIMEDOUT: + msg = "Connection timed out"; + break; + case ECONNREFUSED: + msg = "Connection refused"; + break; + case ELOOP: + msg = "Too many levels of symbolic links"; + break; + case EHOSTDOWN: + msg = "Host is down"; + break; + case EHOSTUNREACH: + msg = "No route to host"; + break; + case EPROCLIM: + msg = "Too many processes"; + break; + case EUSERS: + msg = "Too many users"; + break; + case EDQUOT: + msg = "Disk quota exceeded"; + break; + case ESTALE: + msg = "Stale NFS file handle"; + break; + case EREMOTE: + msg = "Object is remote"; + break; +# 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: + msg = "Overlapped operation aborted"; + break; + case WSA_IO_INCOMPLETE: + msg = "Overlapped I/O event object not in signaled state"; + break; + case WSA_IO_PENDING: + msg = "Overlapped operations will complete later"; + break; + /* 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 is EINPROGRESS */ + /* WSAEALREADY is EALREADY */ + /* WSAENOTSOCK is ENOTSOCK */ + /* WSAEDESTADDRREQ is EDESTADDRREQ */ + /* WSAEMSGSIZE is EMSGSIZE */ + /* WSAEPROTOTYPE is EPROTOTYPE */ + /* WSAENOPROTOOPT is ENOPROTOOPT */ + /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */ + /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */ + /* WSAEOPNOTSUPP is EOPNOTSUPP */ + /* WSAEPFNOSUPPORT is EPFNOSUPPORT */ + /* WSAEAFNOSUPPORT is EAFNOSUPPORT */ + /* WSAEADDRINUSE is EADDRINUSE */ + /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */ + /* WSAENETDOWN is ENETDOWN */ + /* WSAENETUNREACH is ENETUNREACH */ + /* WSAENETRESET is ENETRESET */ + /* WSAECONNABORTED is ECONNABORTED */ + /* WSAECONNRESET is ECONNRESET */ + /* WSAENOBUFS is ENOBUFS */ + /* WSAEISCONN is EISCONN */ + /* WSAENOTCONN is ENOTCONN */ + /* WSAESHUTDOWN is ESHUTDOWN */ + /* WSAETOOMANYREFS is ETOOMANYREFS */ + /* WSAETIMEDOUT is ETIMEDOUT */ + /* WSAECONNREFUSED is ECONNREFUSED */ + /* WSAELOOP is ELOOP */ + /* WSAENAMETOOLONG maps to ENAMETOOLONG */ + /* WSAEHOSTDOWN is EHOSTDOWN */ + /* WSAEHOSTUNREACH is EHOSTUNREACH */ + /* WSAENOTEMPTY maps to ENOTEMPTY */ + /* WSAEPROCLIM is EPROCLIM */ + /* WSAEUSERS is EUSERS */ + /* WSAEDQUOT is EDQUOT */ + /* WSAESTALE is ESTALE */ + /* WSAEREMOTE is EREMOTE */ + case WSASYSNOTREADY: + msg = "Network subsystem is unavailable"; + break; + case WSAVERNOTSUPPORTED: + msg = "Winsock.dll version out of range"; + break; + case WSANOTINITIALISED: + msg = "Successful WSAStartup not yet performed"; + break; + case WSAEDISCON: + msg = "Graceful shutdown in progress"; + break; + case WSAENOMORE: case WSA_E_NO_MORE: + msg = "No more results"; + break; + case WSAECANCELLED: case WSA_E_CANCELLED: + msg = "Call was canceled"; + break; + case WSAEINVALIDPROCTABLE: + msg = "Procedure call table is invalid"; + break; + case WSAEINVALIDPROVIDER: + msg = "Service provider is invalid"; + break; + case WSAEPROVIDERFAILEDINIT: + msg = "Service provider failed to initialize"; + break; + case WSASYSCALLFAILURE: + msg = "System call failure"; + break; + case WSASERVICE_NOT_FOUND: + msg = "Service not found"; + break; + case WSATYPE_NOT_FOUND: + msg = "Class type not found"; + break; + case WSAEREFUSED: + msg = "Database query was refused"; + break; + case WSAHOST_NOT_FOUND: + msg = "Host not found"; + break; + case WSATRY_AGAIN: + msg = "Nonauthoritative host not found"; + break; + case WSANO_RECOVERY: + msg = "Nonrecoverable error"; + break; + case WSANO_DATA: + msg = "Valid name, no data record of requested type"; + break; + /* WSA_QOS_* omitted */ +# endif +# endif + +# if GNULIB_defined_ENOMSG + case ENOMSG: + msg = "No message of desired type"; + break; +# endif + +# if GNULIB_defined_EIDRM + case EIDRM: + msg = "Identifier removed"; + break; +# endif + +# if GNULIB_defined_ENOLINK + case ENOLINK: + msg = "Link has been severed"; + break; +# endif + +# if GNULIB_defined_EPROTO + case EPROTO: + msg = "Protocol error"; + break; +# endif + +# if GNULIB_defined_EMULTIHOP + case EMULTIHOP: + msg = "Multihop attempted"; + break; +# endif + +# if GNULIB_defined_EBADMSG + case EBADMSG: + msg = "Bad message"; + break; +# endif + +# if GNULIB_defined_EOVERFLOW + case EOVERFLOW: + msg = "Value too large for defined data type"; + break; +# endif + +# if GNULIB_defined_ENOTSUP + case ENOTSUP: + msg = "Not supported"; + break; +# endif + +# if GNULIB_defined_ + case ECANCELED: + msg = "Operation canceled"; + break; +# endif } - return result; + if (msg) + return (char *) msg; + + { + char *result = strerror (n); + + if (result == NULL || result[0] == '\0') + { + static char const fmt[] = "Unknown error (%d)"; + static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)]; + sprintf (msg_buf, fmt, n); + return msg_buf; + } + + return result; + } } #endif diff --git a/gl/string.in.h b/gl/string.in.h index 5c7597c..f021a3e 100644 --- a/gl/string.in.h +++ b/gl/string.in.h @@ -18,6 +18,10 @@ #ifndef _GL_STRING_H +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STRING_H@ @@ -93,6 +97,22 @@ extern void *memrchr (void const *, int, size_t) memrchr (a, b, c)) #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@ +extern void *rawmemchr (void const *__s, int __c_in) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK +# undef rawmemchr +# define rawmemchr(a,b) \ + (GL_LINK_WARNING ("rawmemchr is unportable - " \ + "use gnulib module rawmemchr for portability"), \ + rawmemchr (a, b)) +#endif + /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ #if @GNULIB_STPCPY@ # if ! @HAVE_STPCPY@ @@ -149,7 +169,11 @@ extern char *strchrnul (char const *__s, int __c_in) /* Duplicate S, returning an identical malloc'd string. */ #if @GNULIB_STRDUP@ -# if ! @HAVE_DECL_STRDUP@ && ! defined strdup +# if @REPLACE_STRDUP@ +# undef strdup +# define strdup rpl_strdup +# endif +# if !(@HAVE_DECL_STRDUP@ || defined strdup) || @REPLACE_STRDUP@ extern char *strdup (char const *__s); # endif #elif defined GNULIB_POSIXCHECK @@ -560,6 +584,18 @@ extern char *strsignal (int __sig); strsignal (a)) #endif +#if @GNULIB_STRVERSCMP@ +# if !@HAVE_STRVERSCMP@ +extern int strverscmp (const char *, const char *); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strverscmp +# define strverscmp(a, b) \ + (GL_LINK_WARNING ("strverscmp is unportable - " \ + "use gnulib module strverscmp for portability"), \ + strverscmp (a, b)) +#endif + #ifdef __cplusplus } diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h index 5e0b097..dadd56a 100644 --- a/gl/sys_socket.in.h +++ b/gl/sys_socket.in.h @@ -1,5 +1,6 @@ -/* Provide a sys/socket header file for systems lacking it (read: MinGW). - Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. +/* Provide a sys/socket header file for systems lacking it (read: MinGW) + and for systems where it is incomplete. + Copyright (C) 2005-2009 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify @@ -16,8 +17,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* This file is supposed to be used on platforms that lack - and on platforms where cannot be included standalone. +/* This file is supposed to be used on platforms that lack , + on platforms where cannot be included standalone, and on + platforms where does not provide all necessary definitions. It is intended to provide definitions and prototypes needed by an application. */ @@ -25,6 +27,10 @@ #if @HAVE_SYS_SOCKET_H@ +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif + /* On many platforms, assumes prior inclusion of . */ # include @@ -37,7 +43,46 @@ #ifndef _GL_SYS_SOCKET_H #define _GL_SYS_SOCKET_H -#if !@HAVE_SYS_SOCKET_H@ +#if !@HAVE_STRUCT_SOCKADDR_STORAGE@ +# include +/* 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))) + +struct sockaddr_storage +{ + sa_family_t ss_family; /* Address family, etc. */ + __ss_aligntype __ss_align; /* Force desired alignment. */ + char __ss_padding[_SS_PADSIZE]; +}; +#endif + +#if @HAVE_SYS_SOCKET_H@ + +/* A platform that has . */ + +/* 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 + +#else + +# ifdef __CYGWIN__ +# error "Cygwin does have a sys/socket.h, doesn't it?!?" +# endif /* A platform that lacks . @@ -75,14 +120,301 @@ # define SHUT_RDWR SD_BOTH # endif -# if defined _WIN32 || defined __WIN32__ -# define ENOTSOCK WSAENOTSOCK -# define EADDRINUSE WSAEADDRINUSE -# define ENETRESET WSAENETRESET -# define ECONNABORTED WSAECONNABORTED -# define ECONNRESET WSAECONNRESET -# define ENOTCONN WSAENOTCONN -# define ESHUTDOWN WSAESHUTDOWN +/* The definition of GL_LINK_WARNING is copied here. */ + +# if @HAVE_WINSOCK2_H@ +/* Include headers needed by the emulation code. */ +# include +# include + +typedef int socklen_t; + +# endif + +# ifdef __cplusplus +extern "C" { +# endif + +# if @HAVE_WINSOCK2_H@ + +/* Re-define FD_ISSET to avoid a WSA call while we are not using + network sockets. */ +static 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; +} + +# undef FD_ISSET +# define FD_ISSET(fd, set) rpl_fd_isset(fd, set) + +# endif + +/* Wrap everything else to use libc file descriptors for sockets. */ + +# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H +# undef close +# define close close_used_without_including_unistd_h +# endif + +# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H +# undef gethostname +# define gethostname gethostname_used_without_including_unistd_h +# endif + +# if @GNULIB_SOCKET@ +# if @HAVE_WINSOCK2_H@ +# undef socket +# define socket rpl_socket +extern int rpl_socket (int, int, int protocol); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef socket +# define socket socket_used_without_requesting_gnulib_module_socket +# elif defined GNULIB_POSIXCHECK +# undef socket +# define socket(d,t,p) \ + (GL_LINK_WARNING ("socket is not always POSIX compliant - " \ + "use gnulib module socket for portability"), \ + socket (d, t, p)) +# endif + +# if @GNULIB_CONNECT@ +# if @HAVE_WINSOCK2_H@ +# undef connect +# define connect rpl_connect +extern int rpl_connect (int, struct sockaddr *, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef connect +# define connect socket_used_without_requesting_gnulib_module_connect +# elif defined GNULIB_POSIXCHECK +# undef connect +# define connect(s,a,l) \ + (GL_LINK_WARNING ("connect is not always POSIX compliant - " \ + "use gnulib module connect for portability"), \ + connect (s, a, l)) +# endif + +# if @GNULIB_ACCEPT@ +# if @HAVE_WINSOCK2_H@ +# undef accept +# define accept rpl_accept +extern int rpl_accept (int, struct sockaddr *, int *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef accept +# define accept accept_used_without_requesting_gnulib_module_accept +# elif defined GNULIB_POSIXCHECK +# undef accept +# define accept(s,a,l) \ + (GL_LINK_WARNING ("accept is not always POSIX compliant - " \ + "use gnulib module accept for portability"), \ + accept (s, a, l)) +# endif + +# if @GNULIB_BIND@ +# if @HAVE_WINSOCK2_H@ +# undef bind +# define bind rpl_bind +extern int rpl_bind (int, struct sockaddr *, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef bind +# define bind bind_used_without_requesting_gnulib_module_bind +# elif defined GNULIB_POSIXCHECK +# undef bind +# define bind(s,a,l) \ + (GL_LINK_WARNING ("bind is not always POSIX compliant - " \ + "use gnulib module bind for portability"), \ + bind (s, a, l)) +# endif + +# if @GNULIB_GETPEERNAME@ +# if @HAVE_WINSOCK2_H@ +# undef getpeername +# define getpeername rpl_getpeername +extern int rpl_getpeername (int, struct sockaddr *, int *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef getpeername +# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername +# elif defined GNULIB_POSIXCHECK +# undef getpeername +# define getpeername(s,a,l) \ + (GL_LINK_WARNING ("getpeername is not always POSIX compliant - " \ + "use gnulib module getpeername for portability"), \ + getpeername (s, a, l)) +# endif + +# if @GNULIB_GETSOCKNAME@ +# if @HAVE_WINSOCK2_H@ +# undef getsockname +# define getsockname rpl_getsockname +extern int rpl_getsockname (int, struct sockaddr *, int *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef getsockname +# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname +# elif defined GNULIB_POSIXCHECK +# undef getsockname +# define getsockname(s,a,l) \ + (GL_LINK_WARNING ("getsockname is not always POSIX compliant - " \ + "use gnulib module getsockname for portability"), \ + getsockname (s, a, l)) +# endif + +# if @GNULIB_GETSOCKOPT@ +# if @HAVE_WINSOCK2_H@ +# undef getsockopt +# define getsockopt rpl_getsockopt +extern int rpl_getsockopt (int, int, int, void *, socklen_t *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef getsockopt +# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt +# elif defined GNULIB_POSIXCHECK +# undef getsockopt +# define getsockopt(s,lvl,o,v,l) \ + (GL_LINK_WARNING ("getsockopt is not always POSIX compliant - " \ + "use gnulib module getsockopt for portability"), \ + getsockopt (s, lvl, o, v, l)) +# endif + +# if @GNULIB_LISTEN@ +# if @HAVE_WINSOCK2_H@ +# undef listen +# define listen rpl_listen +extern int rpl_listen (int, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef listen +# define listen listen_used_without_requesting_gnulib_module_listen +# elif defined GNULIB_POSIXCHECK +# undef listen +# define listen(s,b) \ + (GL_LINK_WARNING ("listen is not always POSIX compliant - " \ + "use gnulib module listen for portability"), \ + listen (s, b)) +# endif + +# if @GNULIB_RECV@ +# if @HAVE_WINSOCK2_H@ +# undef recv +# define recv rpl_recv +extern int rpl_recv (int, void *, int, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef recv +# define recv recv_used_without_requesting_gnulib_module_recv +# elif defined GNULIB_POSIXCHECK +# undef recv +# define recv(s,b,n,f) \ + (GL_LINK_WARNING ("recv is not always POSIX compliant - " \ + "use gnulib module recv for portability"), \ + recv (s, b, n, f)) +# endif + +# if @GNULIB_SEND@ +# if @HAVE_WINSOCK2_H@ +# undef send +# define send rpl_send +extern int rpl_send (int, const void *, int, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef send +# define send send_used_without_requesting_gnulib_module_send +# elif defined GNULIB_POSIXCHECK +# undef send +# define send(s,b,n,f) \ + (GL_LINK_WARNING ("send is not always POSIX compliant - " \ + "use gnulib module send for portability"), \ + send (s, b, n, f)) +# endif + +# if @GNULIB_RECVFROM@ +# if @HAVE_WINSOCK2_H@ +# undef recvfrom +# define recvfrom rpl_recvfrom +extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef recvfrom +# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom +# elif defined GNULIB_POSIXCHECK +# undef recvfrom +# define recvfrom(s,b,n,f,a,l) \ + (GL_LINK_WARNING ("recvfrom is not always POSIX compliant - " \ + "use gnulib module recvfrom for portability"), \ + recvfrom (s, b, n, f, a, l)) +# endif + +# if @GNULIB_SENDTO@ +# if @HAVE_WINSOCK2_H@ +# undef sendto +# define sendto rpl_sendto +extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef sendto +# define sendto sendto_used_without_requesting_gnulib_module_sendto +# elif defined GNULIB_POSIXCHECK +# undef sendto +# define sendto(s,b,n,f,a,l) \ + (GL_LINK_WARNING ("sendto is not always POSIX compliant - " \ + "use gnulib module sendto for portability"), \ + sendto (s, b, n, f, a, l)) +# endif + +# if @GNULIB_SETSOCKOPT@ +# if @HAVE_WINSOCK2_H@ +# undef setsockopt +# define setsockopt rpl_setsockopt +extern int rpl_setsockopt (int, int, int, const void *, socklen_t); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef setsockopt +# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt +# elif defined GNULIB_POSIXCHECK +# undef setsockopt +# define setsockopt(s,lvl,o,v,l) \ + (GL_LINK_WARNING ("setsockopt is not always POSIX compliant - " \ + "use gnulib module setsockopt for portability"), \ + setsockopt (s, lvl, o, v, l)) +# endif + +# if @GNULIB_SHUTDOWN@ +# if @HAVE_WINSOCK2_H@ +# undef shutdown +# define shutdown rpl_shutdown +extern int rpl_shutdown (int, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef shutdown +# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown +# elif defined GNULIB_POSIXCHECK +# undef shutdown +# define shutdown(s,h) \ + (GL_LINK_WARNING ("shutdown is not always POSIX compliant - " \ + "use gnulib module shutdown for portability"), \ + shutdown (s, h)) +# endif + +# if @HAVE_WINSOCK2_H@ +# undef select +# define select select_used_without_including_sys_select_h +# endif + +# ifdef __cplusplus +} # endif #endif /* HAVE_SYS_SOCKET_H */ diff --git a/gl/time.in.h b/gl/time.in.h new file mode 100644 index 0000000..dec37e8 --- /dev/null +++ b/gl/time.in.h @@ -0,0 +1,118 @@ +/* A more-standard . + + Copyright (C) 2007-2008 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, 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 02110-1301, USA. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* 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. Also, Solaris 8 eventually includes itself + recursively; if that is happening, just include the system + without adding our own declarations. */ +#if (defined __need_time_t || defined __need_clock_t \ + || defined __need_timespec \ + || defined _GL_TIME_H) + +# @INCLUDE_NEXT@ @NEXT_TIME_H@ + +#else + +# define _GL_TIME_H + +# @INCLUDE_NEXT@ @NEXT_TIME_H@ + +# ifdef __cplusplus +extern "C" { +# endif + +/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3). + Or they define it with the wrong member names or define it in + (e.g., FreeBSD circa 1997). */ +# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@ +# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +# include +# else +# undef timespec +# define timespec rpl_timespec +struct timespec +{ + time_t tv_sec; + long int tv_nsec; +}; +# endif +# endif + +/* Sleep for at least RQTP seconds unless interrupted, If interrupted, + return -1 and store the remaining time into RMTP. See + . */ +# if @REPLACE_NANOSLEEP@ +# define nanosleep rpl_nanosleep +int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp); +# endif + +/* Convert TIMER to RESULT, assuming local time and UTC respectively. See + and + . */ +# if @REPLACE_LOCALTIME_R@ +# undef localtime_r +# define localtime_r rpl_localtime_r +# undef gmtime_r +# define gmtime_r rpl_gmtime_r +struct tm *localtime_r (time_t const *restrict __timer, + struct tm *restrict __result); +struct tm *gmtime_r (time_t const *restrict __timer, + struct tm *restrict __result); +# endif + +/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store + the resulting broken-down time into TM. See + . */ +# if @REPLACE_STRPTIME@ +# undef strptime +# define strptime rpl_strptime +char *strptime (char const *restrict __buf, char const *restrict __format, + struct tm *restrict __tm); +# endif + +/* Convert TM to a time_t value, assuming UTC. */ +# if @REPLACE_TIMEGM@ +# undef timegm +# define timegm rpl_timegm +time_t timegm (struct tm *__tm); +# 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 GNULIB_PORTCHECK +# undef asctime +# define asctime eschew_asctime +# undef asctime_r +# define asctime_r eschew_asctime_r +# undef ctime +# define ctime eschew_ctime +# undef ctime_r +# define ctime_r eschew_ctime_r +# endif + +# ifdef __cplusplus +} +# endif + +#endif diff --git a/gl/time_r.c b/gl/time_r.c new file mode 100644 index 0000000..d610e7f --- /dev/null +++ b/gl/time_r.c @@ -0,0 +1,47 @@ +/* Reentrant time functions like localtime_r. + + Copyright (C) 2003, 2006, 2007 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, 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 02110-1301, USA. */ + +/* Written by Paul Eggert. */ + +#include + +#include + +#include + +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..057f645 --- /dev/null +++ b/gl/timegm.c @@ -0,0 +1,41 @@ +/* Convert UTC calendar time to simple time. Like mktime but assumes UTC. + + Copyright (C) 1994, 1997, 2003, 2004, 2006, 2007 Free Software + Foundation, Inc. This file is part of the GNU C Library. + + 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, 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 02110-1301, USA. */ + +#ifndef _LIBC +# include +#endif + +#include + +#ifndef _LIBC +# undef __gmtime_r +# define __gmtime_r gmtime_r +# define __mktime_internal mktime_internal +time_t __mktime_internal (struct tm *, + struct tm * (*) (time_t const *, struct tm *), + time_t *); +#endif + +time_t +timegm (struct tm *tmp) +{ + static time_t gmtime_offset; + tmp->tm_isdst = 0; + return __mktime_internal (tmp, __gmtime_r, &gmtime_offset); +} diff --git a/gl/unistd.in.h b/gl/unistd.in.h index a5dc04c..fa8d84a 100644 --- a/gl/unistd.in.h +++ b/gl/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2004-2007 Free Software Foundation, Inc. + Copyright (C) 2003-2009 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 @@ -17,6 +17,10 @@ #ifndef _GL_UNISTD_H +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + /* The include_next requires a split double-inclusion guard. */ #if @HAVE_UNISTD_H@ # @INCLUDE_NEXT@ @NEXT_UNISTD_H@ @@ -25,17 +29,75 @@ #ifndef _GL_UNISTD_H #define _GL_UNISTD_H -/* mingw doesn't define the SEEK_* macros in . */ +/* mingw doesn't define the SEEK_* or *_FILENO macros in . */ #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) # include #endif /* mingw fails to declare _exit in . */ +/* mingw, BeOS, Haiku declare environ in , not in . */ #include +#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ +/* Get ssize_t. */ +# include +#endif + +#if @GNULIB_GETHOSTNAME@ +/* Get all possible declarations of gethostname(). */ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +# include +# if !defined _GL_SYS_SOCKET_H +# 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 +# endif +# if !defined _GL_SYS_SELECT_H +# undef select +# define select select_used_without_including_sys_select_h +# endif +# endif +#endif + /* The definition of GL_LINK_WARNING is copied here. */ +/* 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 + /* Declare overridden functions. */ #ifdef __cplusplus @@ -68,6 +130,25 @@ extern int chown (const char *file, uid_t uid, gid_t gid); #endif +#if @GNULIB_CLOSE@ +# if @REPLACE_CLOSE@ +/* Automatically included by modules that need a replacement for close. */ +# undef close +# define close rpl_close +extern int close (int); +# endif +#elif @UNISTD_H_HAVE_WINSOCK2_H@ +# undef close +# define close close_used_without_requesting_gnulib_module_close +#elif defined GNULIB_POSIXCHECK +# undef close +# define close(f) \ + (GL_LINK_WARNING ("close does not portably work on sockets - " \ + "use gnulib module close for portability"), \ + close (f)) +#endif + + #if @GNULIB_DUP2@ # if !@HAVE_DUP2@ /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if @@ -86,6 +167,41 @@ extern int dup2 (int oldfd, int newfd); #endif +#if @GNULIB_ENVIRON@ +# 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 +# define environ (*_NSGetEnviron ()) +# else +extern char **environ; +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef environ +# define environ \ + (GL_LINK_WARNING ("environ is unportable - " \ + "use gnulib module environ for portability"), \ + environ) +#endif + + +#if @GNULIB_EUIDACCESS@ +# if !@HAVE_EUIDACCESS@ +/* Like access(), except that is uses the effective user id and group id of + the current process. */ +extern int euidaccess (const char *filename, int mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef euidaccess +# define euidaccess(f,m) \ + (GL_LINK_WARNING ("euidaccess is unportable - " \ + "use gnulib module euidaccess for portability"), \ + euidaccess (f, m)) +#endif + + #if @GNULIB_FCHDIR@ # if @REPLACE_FCHDIR@ @@ -96,8 +212,6 @@ extern int dup2 (int oldfd, int newfd); . */ extern int fchdir (int /*fd*/); -# define close rpl_close -extern int close (int); # define dup rpl_dup extern int dup (int); # define dup2 rpl_dup2 @@ -113,6 +227,23 @@ extern int dup2 (int, int); #endif +#if @GNULIB_FSYNC@ +/* Synchronize changes to a file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2001 specification + . */ +# if !@HAVE_FSYNC@ +extern int fsync (int fd); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fsync +# define fsync(fd) \ + (GL_LINK_WARNING ("fsync is unportable - " \ + "use gnulib module fsync for portability"), \ + fsync (fd)) +#endif + + #if @GNULIB_FTRUNCATE@ # if !@HAVE_FTRUNCATE@ /* Change the size of the file to which FD is opened to become equal to LENGTH. @@ -157,6 +288,70 @@ extern char * getcwd (char *buf, size_t size); #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 !@HAVE_GETDOMAINNAME@ +extern int getdomainname(char *name, size_t len); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getdomainname +# define getdomainname(n,l) \ + (GL_LINK_WARNING ("getdomainname is unportable - " \ + "use gnulib module getdomainname for portability"), \ + getdomainname (n, l)) +#endif + + +#if @GNULIB_GETDTABLESIZE@ +# if !@HAVE_GETDTABLESIZE@ +/* Return the maximum number of file descriptors in the current process. */ +extern int getdtablesize (void); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getdtablesize +# define getdtablesize() \ + (GL_LINK_WARNING ("getdtablesize is unportable - " \ + "use gnulib module getdtablesize for portability"), \ + getdtablesize ()) +#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@ +# undef gethostname +# define gethostname rpl_gethostname +# endif +# if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@ +extern int gethostname(char *name, size_t len); +# endif +#elif @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname +#elif defined GNULIB_POSIXCHECK +# undef gethostname +# define gethostname(n,l) \ + (GL_LINK_WARNING ("gethostname is unportable - " \ + "use gnulib module gethostname for portability"), \ + gethostname (n, l)) +#endif + + #if @GNULIB_GETLOGIN_R@ /* Copies the user's login name to NAME. The array pointed to by NAME has room for SIZE bytes. @@ -238,6 +433,36 @@ extern int getpagesize (void); #endif +#if @GNULIB_GETUSERSHELL@ +# if !@HAVE_GETUSERSHELL@ +/* Return the next valid login shell on the system, or NULL when the end of + the list has been reached. */ +extern char *getusershell (void); +/* Rewind to pointer that is advanced at each getusershell() call. */ +extern void setusershell (void); +/* Free the pointer that is advanced at each getusershell() call and + associated resources. */ +extern void endusershell (void); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getusershell +# define getusershell() \ + (GL_LINK_WARNING ("getusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + getusershell ()) +# undef setusershell +# define setusershell() \ + (GL_LINK_WARNING ("setusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + setusershell ()) +# undef endusershell +# define endusershell() \ + (GL_LINK_WARNING ("endusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + endusershell ()) +#endif + + #if @GNULIB_LCHOWN@ # if @REPLACE_LCHOWN@ /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE @@ -257,6 +482,23 @@ extern int lchown (char const *file, uid_t owner, gid_t group); #endif +#if @GNULIB_LINK@ +/* Create a new hard link for an existing file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2001 specification + . */ +# if !@HAVE_LINK@ +extern int link (const char *path1, const char *path2); +# endif +#elif defined GNULIB_POSIXCHECK +# undef link +# define link(path1,path2) \ + (GL_LINK_WARNING ("link is unportable - " \ + "use gnulib module link for portability"), \ + link (path1, path2)) +#endif + + #if @GNULIB_LSEEK@ # if @REPLACE_LSEEK@ /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. @@ -311,6 +553,22 @@ extern unsigned int sleep (unsigned int n); #endif +#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ +/* Write up to COUNT bytes starting at BUF to file descriptor FD. + See the POSIX:2001 specification + . */ +# undef write +# define write rpl_write +extern ssize_t write (int fd, const void *buf, size_t count); +#endif + + +#ifdef FCHDIR_REPLACEMENT +/* gnulib internal function. */ +extern void _gl_unregister_fd (int fd); +#endif + + #ifdef __cplusplus } #endif diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c index d5b4028..7ac9f43 100644 --- a/gl/vasnprintf.c +++ b/gl/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2008 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2009 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 @@ -95,7 +95,7 @@ #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL # include -# include "isnand.h" +# include "isnand-nolibm.h" #endif #if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL @@ -106,7 +106,7 @@ #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL # include -# include "isnand.h" +# include "isnand-nolibm.h" # include "printf-frexp.h" #endif @@ -117,12 +117,100 @@ # include "fpucw.h" #endif -/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ -#ifndef EOVERFLOW -# define EOVERFLOW E2BIG +/* 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 _snwprintf() function instead. */ +# define SNPRINTF _snwprintf +# 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. */ +# define SNPRINTF _snprintf +# 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. */ +#ifdef lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ #endif -#if HAVE_WCHAR_T +/* 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 && !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 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T && (WIDE_CHAR_VERSION || DCHAR_IS_TCHAR) # if HAVE_WCSLEN # define local_wcslen wcslen # else @@ -145,65 +233,26 @@ local_wcslen (const wchar_t *s) # endif #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 +#if !USE_SNPRINTF && HAVE_WCHAR_T && WIDE_CHAR_VERSION +# if HAVE_WCSNLEN +# define local_wcsnlen wcsnlen # 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 -# 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 _snwprintf() function instead. */ -# define SNPRINTF _snwprintf -# 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. */ -# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ -# define USE_SNPRINTF 1 -# else -# define USE_SNPRINTF 0 -# endif -# if HAVE_DECL__SNPRINTF - /* Windows. */ -# define SNPRINTF _snprintf -# 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 +# 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; -#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL + for (ptr = s; maxlen > 0 && *ptr != (wchar_t) 0; ptr++, maxlen--) + ; + return ptr - s; +} +# 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 @@ -243,11 +292,11 @@ is_infinite_or_zero (double x) #if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL -/* Equivalent to !isfinite(x), but does not require libm. */ +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ static int -is_infinitel (long double x) +is_infinite_or_zerol (long double x) { - return isnanl (x) || (x + x == x && x != 0.0L); + return isnanl (x) || x + x == x; } #endif @@ -364,7 +413,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) 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-(hightest bit in b[n-1]), 0<=s=beta/2. For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).} @@ -1201,7 +1250,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) static char * scale10_round_decimal_long_double (long double x, int n) { - int e; + 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); @@ -1219,7 +1268,7 @@ scale10_round_decimal_long_double (long double x, int n) static char * scale10_round_decimal_double (double x, int n) { - int e; + int e IF_LINT(= 0); mpn_t m; void *memory = decode_double (x, &e, &m); return scale10_round_decimal_decoded (e, m, memory, n); @@ -1306,9 +1355,9 @@ floorlog10l (long double x) } /* Now 0.95 <= z <= 1.01. */ z = 1 - z; - /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ... + /* 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 -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); + 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; @@ -1397,9 +1446,9 @@ floorlog10 (double x) } /* Now 0.95 <= z <= 1.01. */ z = 1 - z; - /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ... + /* 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 -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); + 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; @@ -1409,6 +1458,20 @@ floorlog10 (double x) # 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 DCHAR_T * @@ -1736,18 +1799,18 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, size_t converted_len = allocated - length; # if DCHAR_IS_TCHAR /* Convert from UTF-8 to locale encoding. */ - if (u8_conv_to_encoding (locale_charset (), - iconveh_question_mark, - arg, arg_end - arg, NULL, - &converted, &converted_len) - < 0) + 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); - if (converted == NULL) # endif + if (converted == NULL) { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) @@ -1864,18 +1927,18 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, size_t converted_len = allocated - length; # if DCHAR_IS_TCHAR /* Convert from UTF-16 to locale encoding. */ - if (u16_conv_to_encoding (locale_charset (), - iconveh_question_mark, - arg, arg_end - arg, NULL, - &converted, &converted_len) - < 0) + 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); - if (converted == NULL) # endif + if (converted == NULL) { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) @@ -1992,18 +2055,18 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, size_t converted_len = allocated - length; # if DCHAR_IS_TCHAR /* Convert from UTF-32 to locale encoding. */ - if (u32_conv_to_encoding (locale_charset (), - iconveh_question_mark, - arg, arg_end - arg, NULL, - &converted, &converted_len) - < 0) + 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); - if (converted == NULL) # endif + if (converted == NULL) { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) @@ -2040,6 +2103,522 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } } #endif +#if (!USE_SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && 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; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = (unsigned int) (-arg); + } + else + width = arg; + } + 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. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + 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. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (has_width && width > characters + && !(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 (has_width && width > characters + && (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'. */ + typedef int TCHAR_T_verify[2 * (sizeof (TCHAR_T) == 1) - 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 + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + while (precision > 0) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg_end, &state); +# else + count = wctomb (buf, *arg_end); +# endif + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + if (precision < 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 + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (;;) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg_end, &state); +# else + count = wctomb (buf, *arg_end); +# endif + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + 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 + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + for (remaining = characters; remaining > 0; ) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg, &state); +# else + count = wctomb (buf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (tmpptr, buf, 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) + { + int saved_errno = errno; + free (tmpsrc); + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + free (tmpsrc); +# endif + + if (has_width) + { +# if ENABLE_UNISTDIO + /* Outside POSIX, it's preferrable 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 (has_width && width > w + && !(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 + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + ENSURE_ALLOCATION (xsum (length, characters)); + for (remaining = characters; remaining > 0; ) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg, &state); +# else + count = wctomb (buf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (result + length, buf, count); + length += count; + arg++; + remaining -= count; + } + if (!(arg == arg_end)) + abort (); + } + else + { +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + while (arg < arg_end) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg, &state); +# else + count = wctomb (buf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + ENSURE_ALLOCATION (xsum (length, count)); + memcpy (result + length, buf, count); + length += count; + arg++; + } + } +# else + ENSURE_ALLOCATION (xsum (length, tmpdst_len)); + DCHAR_CPY (result + length, tmpdst, tmpdst_len); + free (tmpdst); + length += tmpdst_len; +# endif + + if (has_width && width > w + && (dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + } +# endif +#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)) @@ -2552,8 +3131,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # elif NEED_PRINTF_INFINITE_LONG_DOUBLE || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE /* Some systems produce wrong output for Inf, - -Inf, and NaN. */ - && is_infinitel (a.arg[dp->arg_index].a.a_longdouble)) + -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 )) { @@ -2635,9 +3216,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* 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. */ + the same default precision also for %g, %G. But for %a, %A, + the default precision is 0. */ if (!has_precision) - precision = 6; + if (!(dp->conversion == 'a' || dp->conversion == 'A')) + precision = 6; /* Allocate a temporary buffer of sufficient size. */ # if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE @@ -2858,8 +3441,32 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, 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) { @@ -2971,6 +3578,30 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, 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. */ @@ -3065,7 +3696,65 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, abort (); # else /* arg is finite. */ - abort (); + 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 } @@ -3211,8 +3900,31 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, 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) { @@ -3337,6 +4049,29 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, 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. */ @@ -3588,7 +4323,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #endif TCHAR_T *fbp; unsigned int prefix_count; - int prefixes[2]; + int prefixes[2] IF_LINT (= { 0 }); #if !USE_SNPRINTF size_t tmp_length; TCHAR_T tmpbuf[700]; @@ -3661,6 +4396,44 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } #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. */ @@ -3812,16 +4585,64 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # if HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { - tmp_length = - local_wcslen (a.arg[dp->arg_index].a.a_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 = + a.arg[dp->arg_index].a.a_wide_string; -# if !WIDE_CHAR_VERSION - tmp_length = xtimes (tmp_length, MB_CUR_MAX); + 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 above. */ + abort (); # endif } else # endif - tmp_length = strlen (a.arg[dp->arg_index].a.a_string); + { +# 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 above. */ + 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 = a.arg[dp->arg_index].a.a_string; + + if (has_precision) + tmp_length = local_strnlen (arg, precision); + else + tmp_length = strlen (arg); +# endif + } break; case 'p': @@ -3837,18 +4658,22 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, 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); + /* 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; + /* 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 */ } @@ -3869,44 +4694,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } #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 - /* Construct the format string for calling snprintf or sprintf. */ fbp = buf; @@ -4052,7 +4839,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, abort (); prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; } - if (dp->precision_arg_index != ARG_NONE) + if (!prec_ourselves && dp->precision_arg_index != ARG_NONE) { if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); @@ -4403,14 +5190,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } #endif -#if !DCHAR_IS_TCHAR -# if !USE_SNPRINTF +#if !USE_SNPRINTF if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); -# endif +#endif +#if !DCHAR_IS_TCHAR /* Convert from TCHAR_T[] to DCHAR_T[]. */ if (dp->conversion == 'c' || dp->conversion == 's') { @@ -4428,14 +5215,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # else tmpsrc = tmp; # endif - tmpdst = NULL; - tmpdst_len = 0; - if (DCHAR_CONV_FROM_ENCODING (locale_charset (), - iconveh_question_mark, - tmpsrc, count, - NULL, - &tmpdst, &tmpdst_len) - < 0) + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, count, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) @@ -4528,7 +5314,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (w < width) { size_t pad = width - w; -# if USE_SNPRINTF + /* Make room for the result. */ if (xsum (count, pad) > allocated - length) { @@ -4538,12 +5324,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, 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. */ -# endif + { # if !DCHAR_IS_TCHAR || USE_SNPRINTF DCHAR_T * const rp = result + length; @@ -4553,7 +5343,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, DCHAR_T *p = rp + count; DCHAR_T *end = p + pad; DCHAR_T *pad_ptr; -# if !DCHAR_IS_TCHAR +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO if (dp->conversion == 'c' || dp->conversion == 's') /* No zero-padding for string directives. */ @@ -4604,13 +5394,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } #endif -#if DCHAR_IS_TCHAR && !USE_SNPRINTF - if (count >= tmp_length) - /* tmp_length was incorrectly calculated - fix the - code above! */ - abort (); -#endif - /* Here still count <= allocated - length. */ #if !DCHAR_IS_TCHAR || USE_SNPRINTF diff --git a/gl/vasprintf.c b/gl/vasprintf.c index 90f64e9..d1b8137 100644 --- a/gl/vasprintf.c +++ b/gl/vasprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2006-2008 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 @@ -30,11 +30,6 @@ #include "vasnprintf.h" -/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ -#ifndef EOVERFLOW -# define EOVERFLOW E2BIG -#endif - int vasprintf (char **resultp, const char *format, va_list args) { diff --git a/gl/verify.h b/gl/verify.h new file mode 100644 index 0000000..fac53f6 --- /dev/null +++ b/gl/verify.h @@ -0,0 +1,140 @@ +/* Compile-time assert-like macros. + + Copyright (C) 2005, 2006 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 . */ + +/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ + +#ifndef VERIFY_H +# define VERIFY_H 1 + +/* 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_true (R) is for scalar contexts, including + integer constant expression contexts. verify (R) is for declaration + contexts, e.g., the top level. + + Symbols ending in "__" are private to this header. + + The code below uses several ideas. + + * 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 verify_type__ { unsigned int verify_error_if_negative_size__: 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 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. + + 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 verify_type__ {...})]; + extern void dummy (int [sizeof (struct {...})]); + extern void dummy (int [sizeof (struct verify_type__ {...})]); + extern int (*dummy (void)) [sizeof (struct {...})]; + extern int (*dummy (void)) [sizeof (struct 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 {...})]; + + * This implementation exploits the fact that GCC does not warn about + the last declaration mentioned above. If a future version of GCC + introduces a warning for this, the problem could be worked around + by using code specialized to GCC, e.g.,: + + #if 4 <= __GNUC__ + # define verify(R) \ + extern int (* verify_function__ (void)) \ + [__builtin_constant_p (R) && (R) ? 1 : -1] + #endif + + * In C++, any struct definition inside sizeof is invalid. + Use a template type to work around the problem. */ + + +/* Verify requirement R at compile-time, as an integer constant expression. + Return 1. */ + +# ifdef __cplusplus +template + struct verify_type__ { unsigned int verify_error_if_negative_size__: w; }; +# define verify_true(R) \ + (!!sizeof (verify_type__<(R) ? 1 : -1>)) +# else +# define verify_true(R) \ + (!!sizeof \ + (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; })) +# endif + +/* Verify requirement R at compile-time, as a declaration without a + trailing ';'. */ + +# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)] + +#endif diff --git a/gl/vsnprintf.c b/gl/vsnprintf.c index cc8f61f..02af252 100644 --- a/gl/vsnprintf.c +++ b/gl/vsnprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc. Written by Simon Josefsson and Yoann Vandoorselaere . This program is free software; you can redistribute it and/or modify @@ -31,11 +31,6 @@ #include "vasnprintf.h" -/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ -#ifndef EOVERFLOW -# define EOVERFLOW E2BIG -#endif - /* 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). diff --git a/gl/wchar.in.h b/gl/wchar.in.h index b721572..cc5baad 100644 --- a/gl/wchar.in.h +++ b/gl/wchar.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that have issues. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2009 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 @@ -26,8 +26,32 @@ * the declaration of wcwidth(). */ +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +#if defined __need_mbstate_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H +/* Special invocation convention: + - Inside uClibc header files. + - On HP-UX 11.00 we have a sequence of nested includes + -> -> , and the latter includes , + once indirectly -> -> -> + 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 . + - On IRIX 6.5, similarly, we have an include -> , and + the latter includes . But here, we have no way to detect whether + is completely included or is still being included. */ + +#@INCLUDE_NEXT@ @NEXT_WCHAR_H@ + +#else +/* Normal invocation convention. */ + #ifndef _GL_WCHAR_H +#define _GL_ALREADY_INCLUDING_WCHAR_H + /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be @@ -43,6 +67,8 @@ # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ #endif +#undef _GL_ALREADY_INCLUDING_WCHAR_H + #ifndef _GL_WCHAR_H #define _GL_WCHAR_H @@ -53,6 +79,207 @@ extern "C" { #endif +/* Define wint_t. (Also done in wctype.in.h.) */ +#if !@HAVE_WINT_T@ && !defined wint_t +# define wint_t int +# ifndef WEOF +# define WEOF -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. */ +#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ +typedef int rpl_mbstate_t; +# undef mbstate_t +# define mbstate_t rpl_mbstate_t +# define GNULIB_defined_mbstate_t 1 +#endif + + +/* Convert a single-byte character to a wide character. */ +#if @GNULIB_BTOWC@ +# if @REPLACE_BTOWC@ +# undef btowc +# define btowc rpl_btowc +# endif +# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@ +extern wint_t btowc (int c); +# endif +#elif defined GNULIB_POSIXCHECK +# undef btowc +# define btowc(c) \ + (GL_LINK_WARNING ("btowc is unportable - " \ + "use gnulib module btowc for portability"), \ + btowc (c)) +#endif + + +/* Convert a wide character to a single-byte character. */ +#if @GNULIB_WCTOB@ +# if @REPLACE_WCTOB@ +# undef wctob +# define wctob rpl_wctob +# endif +# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@ +/* wctob is provided by gnulib, or wctob exists but is not declared. */ +extern int wctob (wint_t wc); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wctob +# define wctob(w) \ + (GL_LINK_WARNING ("wctob is unportable - " \ + "use gnulib module wctob for portability"), \ + wctob (w)) +#endif + + +/* Test whether *PS is in the initial state. */ +#if @GNULIB_MBSINIT@ +# if @REPLACE_MBSINIT@ +# undef mbsinit +# define mbsinit rpl_mbsinit +# endif +# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@ +extern int mbsinit (const mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbsinit +# define mbsinit(p) \ + (GL_LINK_WARNING ("mbsinit is unportable - " \ + "use gnulib module mbsinit for portability"), \ + mbsinit (p)) +#endif + + +/* Convert a multibyte character to a wide character. */ +#if @GNULIB_MBRTOWC@ +# if @REPLACE_MBRTOWC@ +# undef mbrtowc +# define mbrtowc rpl_mbrtowc +# endif +# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@ +extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbrtowc +# define mbrtowc(w,s,n,p) \ + (GL_LINK_WARNING ("mbrtowc is unportable - " \ + "use gnulib module mbrtowc for portability"), \ + mbrtowc (w, s, n, p)) +#endif + + +/* Recognize a multibyte character. */ +#if @GNULIB_MBRLEN@ +# if @REPLACE_MBRLEN@ +# undef mbrlen +# define mbrlen rpl_mbrlen +# endif +# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@ +extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbrlen +# define mbrlen(s,n,p) \ + (GL_LINK_WARNING ("mbrlen is unportable - " \ + "use gnulib module mbrlen for portability"), \ + mbrlen (s, n, p)) +#endif + + +/* Convert a string to a wide string. */ +#if @GNULIB_MBSRTOWCS@ +# if @REPLACE_MBSRTOWCS@ +# undef mbsrtowcs +# define mbsrtowcs rpl_mbsrtowcs +# endif +# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@ +extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbsrtowcs +# define mbsrtowcs(d,s,l,p) \ + (GL_LINK_WARNING ("mbsrtowcs is unportable - " \ + "use gnulib module mbsrtowcs for portability"), \ + mbsrtowcs (d, s, l, p)) +#endif + + +/* Convert a string to a wide string. */ +#if @GNULIB_MBSNRTOWCS@ +# if @REPLACE_MBSNRTOWCS@ +# undef mbsnrtowcs +# define mbsnrtowcs rpl_mbsnrtowcs +# endif +# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@ +extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbsnrtowcs +# define mbsnrtowcs(d,s,n,l,p) \ + (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \ + "use gnulib module mbsnrtowcs for portability"), \ + mbsnrtowcs (d, s, n, l, p)) +#endif + + +/* Convert a wide character to a multibyte character. */ +#if @GNULIB_WCRTOMB@ +# if @REPLACE_WCRTOMB@ +# undef wcrtomb +# define wcrtomb rpl_wcrtomb +# endif +# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@ +extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcrtomb +# define wcrtomb(s,w,p) \ + (GL_LINK_WARNING ("wcrtomb is unportable - " \ + "use gnulib module wcrtomb for portability"), \ + wcrtomb (s, w, p)) +#endif + + +/* Convert a wide string to a string. */ +#if @GNULIB_WCSRTOMBS@ +# if @REPLACE_WCSRTOMBS@ +# undef wcsrtombs +# define wcsrtombs rpl_wcsrtombs +# endif +# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@ +extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsrtombs +# define wcsrtombs(d,s,l,p) \ + (GL_LINK_WARNING ("wcsrtombs is unportable - " \ + "use gnulib module wcsrtombs for portability"), \ + wcsrtombs (d, s, l, p)) +#endif + + +/* Convert a wide string to a string. */ +#if @GNULIB_WCSNRTOMBS@ +# if @REPLACE_WCSNRTOMBS@ +# undef wcsnrtombs +# define wcsnrtombs rpl_wcsnrtombs +# endif +# if !@HAVE_WCSNRTOMBS@ || @REPLACE_WCSNRTOMBS@ +extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsnrtombs +# define wcsnrtombs(d,s,n,l,p) \ + (GL_LINK_WARNING ("wcsnrtombs is unportable - " \ + "use gnulib module wcsnrtombs for portability"), \ + wcsnrtombs (d, s, n, l, p)) +#endif + + /* Return the number of screen columns needed for WC. */ #if @GNULIB_WCWIDTH@ # if @REPLACE_WCWIDTH@ @@ -80,3 +307,4 @@ extern int wcwidth (int /* actually wchar_t */); #endif /* _GL_WCHAR_H */ #endif /* _GL_WCHAR_H */ +#endif diff --git a/gl/wcrtomb.c b/gl/wcrtomb.c new file mode 100644 index 0000000..79df99f --- /dev/null +++ b/gl/wcrtomb.c @@ -0,0 +1,53 @@ +/* Convert wide character to multibyte character. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + 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 . */ + +#include + +/* Specification. */ +#include + +#include +#include + + +size_t +wcrtomb (char *s, wchar_t wc, mbstate_t *ps) +{ + /* This implementation of wcrtomb on top of wctomb() supports only + stateless encodings. ps must be in the initial state. */ + if (ps != NULL && !mbsinit (ps)) + { + errno = EINVAL; + return (size_t)(-1); + } + + if (s == NULL) + /* We know the NUL wide character corresponds to the NUL character. */ + return 1; + else + { + int ret = wctomb (s, wc); + + if (ret >= 0) + return ret; + else + { + errno = EILSEQ; + return (size_t)(-1); + } + } +} diff --git a/gl/wctype.in.h b/gl/wctype.in.h index a86b5ad..f008d8f 100644 --- a/gl/wctype.in.h +++ b/gl/wctype.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that lack it. - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006-2008 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 @@ -28,6 +28,10 @@ #ifndef _GL_WCTYPE_H +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + #if @HAVE_WINT_T@ /* Solaris 2.5 has a bug: must be included before . Tru64 with Desktop Toolkit C has a bug: must be included before @@ -50,15 +54,18 @@ #ifndef _GL_WCTYPE_H #define _GL_WCTYPE_H -#if @HAVE_WINT_T@ -typedef wint_t __wctype_wint_t; -#else -typedef int __wctype_wint_t; +/* Define wint_t. (Also done in wchar.in.h.) */ +#if !@HAVE_WINT_T@ && !defined wint_t +# define wint_t int +# ifndef WEOF +# define WEOF -1 +# endif #endif /* FreeBSD 4.4 to 4.11 has but lacks the functions. + Linux libc5 has and the functions but they are broken. Assume all 12 functions are implemented the same way, or not at all. */ -#if ! @HAVE_ISWCNTRL@ +#if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@ /* IRIX 5.3 has macros but no functions, its isw* macros refer to an undefined variable _ctmp_ and to macros like _P, and they @@ -78,57 +85,73 @@ typedef int __wctype_wint_t; # undef iswupper # undef iswxdigit +/* Linux libc5 has and the functions but they are broken. */ +# if @REPLACE_ISWCNTRL@ +# 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 + static inline int -iswalnum (__wctype_wint_t wc) +iswalnum (wint_t wc) { return ((wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')); } static inline int -iswalpha (__wctype_wint_t wc) +iswalpha (wint_t wc) { return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'; } static inline int -iswblank (__wctype_wint_t wc) +iswblank (wint_t wc) { return wc == ' ' || wc == '\t'; } static inline int -iswcntrl (__wctype_wint_t wc) +iswcntrl (wint_t wc) { return (wc & ~0x1f) == 0 || wc == 0x7f; } static inline int -iswdigit (__wctype_wint_t wc) +iswdigit (wint_t wc) { return wc >= '0' && wc <= '9'; } static inline int -iswgraph (__wctype_wint_t wc) +iswgraph (wint_t wc) { return wc >= '!' && wc <= '~'; } static inline int -iswlower (__wctype_wint_t wc) +iswlower (wint_t wc) { return wc >= 'a' && wc <= 'z'; } static inline int -iswprint (__wctype_wint_t wc) +iswprint (wint_t wc) { return wc >= ' ' && wc <= '~'; } static inline int -iswpunct (__wctype_wint_t wc) +iswpunct (wint_t wc) { return (wc >= '!' && wc <= '~' && !((wc >= '0' && wc <= '9') @@ -136,20 +159,20 @@ iswpunct (__wctype_wint_t wc) } static inline int -iswspace (__wctype_wint_t wc) +iswspace (wint_t wc) { return (wc == ' ' || wc == '\t' || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r'); } static inline int -iswupper (__wctype_wint_t wc) +iswupper (wint_t wc) { return wc >= 'A' && wc <= 'Z'; } static inline int -iswxdigit (__wctype_wint_t wc) +iswxdigit (wint_t wc) { return ((wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')); diff --git a/gl/write.c b/gl/write.c new file mode 100644 index 0000000..250b5cc --- /dev/null +++ b/gl/write.c @@ -0,0 +1,62 @@ +/* POSIX compatible write() function. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + 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 . */ + +#include + +/* Specification. */ +#include + +/* Replace this function only if module 'sigpipe' is requested. */ +#if 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. */ + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# include +# include +# include + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include + +ssize_t +rpl_write (int fd, const void *buf, size_t count) +#undef write +{ + ssize_t ret = write (fd, buf, count); + + if (ret < 0) + { + if (GetLastError () == ERROR_NO_DATA + && GetFileType (_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; + } + } + return ret; +} + +# endif +#endif diff --git a/gl/xalloc.h b/gl/xalloc.h index 40dcf4b..57a13e0 100644 --- a/gl/xalloc.h +++ b/gl/xalloc.h @@ -37,6 +37,14 @@ extern "C" { # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) # endif +# ifndef ATTRIBUTE_MALLOC +# if __GNUC__ >= 3 +# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +# else +# define ATTRIBUTE_MALLOC +# endif +# endif + /* 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 @@ -44,13 +52,13 @@ extern "C" { memory allocation failure. */ extern void xalloc_die (void) ATTRIBUTE_NORETURN; -void *xmalloc (size_t s); -void *xzalloc (size_t s); -void *xcalloc (size_t n, size_t s); +void *xmalloc (size_t s) ATTRIBUTE_MALLOC; +void *xzalloc (size_t s) ATTRIBUTE_MALLOC; +void *xcalloc (size_t n, size_t s) ATTRIBUTE_MALLOC; void *xrealloc (void *p, size_t s); void *x2realloc (void *p, size_t *pn); -void *xmemdup (void const *p, size_t s); -char *xstrdup (char const *str); +void *xmemdup (void const *p, size_t s) ATTRIBUTE_MALLOC; +char *xstrdup (char const *str) ATTRIBUTE_MALLOC; /* Return 1 if an array of N objects, each of size S, cannot exist due to size arithmetic overflow. S must be positive and N must be @@ -97,10 +105,10 @@ char *xstrdup (char const *str); # if HAVE_INLINE # define static_inline static inline # else - void *xnmalloc (size_t n, size_t s); + void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC; void *xnrealloc (void *p, size_t n, size_t s); void *x2nrealloc (void *p, size_t *pn, size_t s); - char *xcharalloc (size_t n); + char *xcharalloc (size_t n) ATTRIBUTE_MALLOC; # endif # ifdef static_inline @@ -108,6 +116,7 @@ char *xstrdup (char const *str); /* Allocate an array of N objects, each with S bytes of memory, dynamically, with error checking. S must be nonzero. */ +static_inline void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC; static_inline void * xnmalloc (size_t n, size_t s) { @@ -219,6 +228,7 @@ x2nrealloc (void *p, size_t *pn, size_t s) /* Return a pointer to a new buffer of N bytes. This is like xmalloc, except it returns char *. */ +static_inline char *xcharalloc (size_t n) ATTRIBUTE_MALLOC; static_inline char * xcharalloc (size_t n) { diff --git a/gl/xmalloc.c b/gl/xmalloc.c index 3a12345..585fb4b 100644 --- a/gl/xmalloc.c +++ b/gl/xmalloc.c @@ -1,7 +1,7 @@ /* xmalloc.c -- malloc with out of memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, + 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2008-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -28,10 +28,6 @@ #include #include -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - /* 1 if calloc is known to be compatible with GNU calloc. This matters if we are not also using the calloc module, which defines HAVE_CALLOC and supports the GNU API even on non-GNU platforms. */ diff --git a/gl/xsize.h b/gl/xsize.h index b294d66..284cf7f 100644 --- a/gl/xsize.h +++ b/gl/xsize.h @@ -1,6 +1,6 @@ /* xsize.h -- Checked size_t computations. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2008 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 @@ -94,7 +94,7 @@ xmax (size_t size1, size_t 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 an inline function, so that it works correctly even - when N is of a wider tupe and N > SIZE_MAX. */ + 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) diff --git a/lib/Makefile.am b/lib/Makefile.am index 73c1291..17e4c1b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = tests +SUBDIRS = . tests noinst_LIBRARIES = libnagiosplug.a diff --git a/lib/Makefile.in b/lib/Makefile.in index 5d34fd7..da2fd7b 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -40,17 +40,19 @@ subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ - $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ - $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \ - $(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \ - $(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \ + $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \ + $(top_srcdir)/gl/m4/dos.m4 \ $(top_srcdir)/gl/m4/double-slash-root.m4 \ - $(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \ + $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \ $(top_srcdir)/gl/m4/exitfail.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-safer.m4 \ - $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \ + $(top_srcdir)/gl/m4/floorf.m4 \ $(top_srcdir)/gl/m4/fstypename.m4 \ $(top_srcdir)/gl/m4/fsusage.m4 \ $(top_srcdir)/gl/m4/getaddrinfo.m4 \ @@ -60,7 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/glibc21.m4 \ $(top_srcdir)/gl/m4/gnulib-common.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ - $(top_srcdir)/gl/m4/iconv.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/iconv.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \ $(top_srcdir)/gl/m4/intlmacosx.m4 \ @@ -69,17 +71,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \ $(top_srcdir)/gl/m4/lib-prefix.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/longlong.m4 \ $(top_srcdir)/gl/m4/ls-mntd-fs.m4 \ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \ $(top_srcdir)/gl/m4/mountlist.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/nls.m4 \ - $(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \ + $(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \ $(top_srcdir)/gl/m4/safe-read.m4 \ $(top_srcdir)/gl/m4/safe-write.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \ $(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \ @@ -89,13 +98,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \ $(top_srcdir)/gl/m4/strnlen.m4 \ $(top_srcdir)/gl/m4/sys_socket_h.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/unistd-safer.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/vasnprintf.m4 \ $(top_srcdir)/gl/m4/vasprintf.m4 \ $(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \ - $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \ - $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \ + $(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ + $(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -144,6 +156,7 @@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ @@ -174,16 +187,24 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +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@ F77 = @F77@ +FCNTL_H = @FCNTL_H@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ @@ -192,47 +213,85 @@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPL = @GNULIB_FREXPL@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -242,18 +301,37 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_ROUND = @GNULIB_ROUND@ GNULIB_ROUNDF = @GNULIB_ROUNDF@ GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ @@ -266,32 +344,57 @@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ 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_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ @@ -304,25 +407,46 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_OS_H = @HAVE_OS_H@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ @@ -336,8 +460,16 @@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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@ @@ -345,14 +477,20 @@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +HOSTENT_LIB = @HOSTENT_LIB@ HOSTNAME = @HOSTNAME@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -374,6 +512,10 @@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -386,15 +528,21 @@ MYSQLCFLAGS = @MYSQLCFLAGS@ MYSQLINCLUDE = @MYSQLINCLUDE@ MYSQLLIBS = @MYSQLLIBS@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_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@ @@ -436,16 +584,23 @@ PKG_ARCH = @PKG_ARCH@ PLUGIN_TEST = @PLUGIN_TEST@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PST3CFLAGS = @PST3CFLAGS@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ PYTHON = @PYTHON@ RADIUSLIBS = @RADIUSLIBS@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ +RELEASE_PRESENT_FALSE = @RELEASE_PRESENT_FALSE@ +RELEASE_PRESENT_TRUE = @RELEASE_PRESENT_TRUE@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -461,12 +616,28 @@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ +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_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -476,19 +647,32 @@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ 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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ REV_DATESTAMP = @REV_DATESTAMP@ REV_TIMESTAMP = @REV_TIMESTAMP@ SCRIPT_TEST = @SCRIPT_TEST@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ @@ -502,6 +686,11 @@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_LIBTAP_LOCAL_FALSE = @USE_LIBTAP_LOCAL_FALSE@ +USE_LIBTAP_LOCAL_TRUE = @USE_LIBTAP_LOCAL_TRUE@ USE_NLS = @USE_NLS@ USE_PARSE_INI_FALSE = @USE_PARSE_INI_FALSE@ USE_PARSE_INI_TRUE = @USE_PARSE_INI_TRUE@ @@ -569,7 +758,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ with_trusted_path = @with_trusted_path@ -SUBDIRS = tests +SUBDIRS = . tests noinst_LIBRARIES = libnagiosplug.a libnagiosplug_a_SOURCES = utils_base.c utils_disk.c utils_tcp.c \ utils_cmd.c $(am__append_1) diff --git a/lib/extra_opts.c b/lib/extra_opts.c index b555417..2939c7a 100644 --- a/lib/extra_opts.c +++ b/lib/extra_opts.c @@ -5,9 +5,6 @@ * License: GPL * Copyright (c) 2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-03-15 18:42:01 -0400 (Sat, 15 Mar 2008) $ -* -* * 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 @@ -21,8 +18,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: parse_ini.c 1950 2008-03-15 22:42:01Z dermoth $ -* *****************************************************************************/ #include "common.h" @@ -103,14 +98,13 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){ ea_tmp=extra_args; while(ea_tmp->next) { ea_tmp=ea_tmp->next; - ea_num++; } ea_tmp->next=ea1; + while(ea1=ea1->next) ea_num++; } ea1=ea_tmp=NULL; } - /* lather, rince, repeat */ - } + } /* lather, rince, repeat */ if(ea_num==*argc && extra_args==NULL){ /* No extra-opts */ diff --git a/lib/extra_opts.h b/lib/extra_opts.h index 0cb47fb..4bb7b73 100644 --- a/lib/extra_opts.h +++ b/lib/extra_opts.h @@ -8,11 +8,14 @@ /* 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 ord of --extra-opts + * 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); diff --git a/lib/parse_ini.c b/lib/parse_ini.c index e9e960e..004396f 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c @@ -5,9 +5,6 @@ * License: GPL * Copyright (c) 2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-04-04 11:11:22 +0100 (Fri, 04 Apr 2008) $ -* -* * 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 @@ -21,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: parse_ini.c 1976 2008-04-04 10:11:22Z dermoth $ * *****************************************************************************/ @@ -79,10 +75,13 @@ static void parse_locator(const char *locator, const char *def_stanza, np_ini_in /* if there is no @file part */ if(stanza_len==locator_len){ i->file=default_file(); + if(strcmp(i->file, "") == 0){ + die(STATE_UNKNOWN, _("Cannot find '%s' or '%s' in any standard location.\n"), NP_DEFAULT_INI_FILENAME1, NP_DEFAULT_INI_FILENAME2); + } } else { i->file=strdup(&(locator[stanza_len+1])); } - + if(i->file==NULL || i->stanza==NULL){ die(STATE_UNKNOWN, _("malloc() failed!\n")); } @@ -110,7 +109,7 @@ np_arg_list* np_get_defaults(const char *locator, const char *default_section){ if(inifile!=stdin) fclose(inifile); } free(i.stanza); - return defaults; + return defaults; } /* read_defaults is where the meat of the parsing takes place. @@ -132,6 +131,7 @@ static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts){ if(isspace(c)) continue; switch(c){ /* globble up coment lines */ + case ';': case '#': GOBBLE_TO(f, c, '\n'); break; @@ -160,7 +160,7 @@ static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts){ default: switch(stanzastate){ /* we never found the start of the first stanza, so - * we're dealing with a config error + * we're dealing with a config error */ case NOSTANZA: die(STATE_UNKNOWN, _("Config file error")); @@ -232,10 +232,8 @@ static int add_option(FILE *f, np_arg_list **optlst){ if(optptr==eqptr) die(STATE_UNKNOWN, _("Config file error\n")); /* continue from '=' to start of value or EOL */ for(valptr=eqptr+1; valptrMAX_INPUT_BUFFER) return -1; strncpy(temp_file,env,len); diff --git a/lib/parse_ini.h b/lib/parse_ini.h index 6357a0e..e0ba816 100644 --- a/lib/parse_ini.h +++ b/lib/parse_ini.h @@ -14,7 +14,7 @@ typedef struct np_arg_el { } np_arg_list; /* FIXME: This is in plugins/common.c. Should be eventually moved to lib/ - * (although for this particular one a configure settings should be ideal) + * (although for this particular one a configure settings should be ideal) */ #ifndef MAX_INPUT_BUFFER # define MAX_INPUT_BUFFER 8192 diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am index 25e2bed..694baf0 100644 --- a/lib/tests/Makefile.am +++ b/lib/tests/Makefile.am @@ -7,48 +7,28 @@ check_PROGRAMS = @EXTRA_TEST@ INCLUDES = -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_ini test_opts +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_ini.t test_opts.t test_tcp.t test_utils.t +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) -LIBS = @LIBINTL@ +LIBS = @LTLIBINTL@ -test_utils_SOURCES = test_utils.c -test_utils_CFLAGS = -g -I.. -test_utils_LDFLAGS = -L/usr/local/lib -ltap -test_utils_LDADD = ../utils_base.o +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 -test_disk_SOURCES = test_disk.c -test_disk_CFLAGS = -g -I.. -test_disk_LDFLAGS = -L/usr/local/lib -ltap -test_disk_LDADD = ../utils_disk.o $(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/libnagiosplug.a $(top_srcdir)/gl/libgnu.a -test_tcp_SOURCES = test_tcp.c -test_tcp_CFLAGS = -g -I.. -test_tcp_LDFLAGS = -L/usr/local/lib -ltap -test_tcp_LDADD = ../utils_tcp.o - -test_cmd_SOURCES = test_cmd.c -test_cmd_CFLAGS = -g -I.. -test_cmd_LDFLAGS = -L/usr/local/lib -ltap -test_cmd_LDADD = ../utils_cmd.o ../utils_base.o - -test_base64_SOURCES = test_base64.c -test_base64_CFLAGS = -g -I.. -test_base64_LDFLAGS = -L/usr/local/lib -ltap -test_base64_LDADD = $(top_srcdir)/gl/base64.o - -test_ini_SOURCES = test_ini.c -test_ini_CFLAGS = -g -I.. -test_ini_LDFLAGS = -L/usr/local/lib -ltap -test_ini_LDADD = ../utils_base.o ../parse_ini.o - -test_opts_SOURCES = test_opts.c -test_opts_CFLAGS = -g -I.. -test_opts_LDFLAGS = -L/usr/local/lib -ltap -test_opts_LDADD = ../utils_base.o ../parse_ini.o ../extra_opts.o +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) diff --git a/lib/tests/Makefile.in b/lib/tests/Makefile.in index 415c9b2..c6f7c52 100644 --- a/lib/tests/Makefile.in +++ b/lib/tests/Makefile.in @@ -39,22 +39,25 @@ noinst_PROGRAMS = @EXTRA_TEST@ check_PROGRAMS = @EXTRA_TEST@ EXTRA_PROGRAMS = test_utils$(EXEEXT) test_disk$(EXEEXT) \ test_tcp$(EXEEXT) test_cmd$(EXEEXT) test_base64$(EXEEXT) \ - test_ini$(EXEEXT) test_opts$(EXEEXT) + test_ini1$(EXEEXT) test_ini3$(EXEEXT) test_opts1$(EXEEXT) \ + test_opts2$(EXEEXT) test_opts3$(EXEEXT) subdir = lib/tests DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ - $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ - $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \ - $(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \ - $(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \ + $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \ + $(top_srcdir)/gl/m4/dos.m4 \ $(top_srcdir)/gl/m4/double-slash-root.m4 \ - $(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \ + $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \ $(top_srcdir)/gl/m4/exitfail.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-safer.m4 \ - $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \ + $(top_srcdir)/gl/m4/floorf.m4 \ $(top_srcdir)/gl/m4/fstypename.m4 \ $(top_srcdir)/gl/m4/fsusage.m4 \ $(top_srcdir)/gl/m4/getaddrinfo.m4 \ @@ -64,7 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/glibc21.m4 \ $(top_srcdir)/gl/m4/gnulib-common.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ - $(top_srcdir)/gl/m4/iconv.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/iconv.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \ $(top_srcdir)/gl/m4/intlmacosx.m4 \ @@ -73,17 +76,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \ $(top_srcdir)/gl/m4/lib-prefix.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/longlong.m4 \ $(top_srcdir)/gl/m4/ls-mntd-fs.m4 \ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \ $(top_srcdir)/gl/m4/mountlist.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/nls.m4 \ - $(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \ + $(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \ $(top_srcdir)/gl/m4/safe-read.m4 \ $(top_srcdir)/gl/m4/safe-write.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \ $(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \ @@ -93,13 +103,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \ $(top_srcdir)/gl/m4/strnlen.m4 \ $(top_srcdir)/gl/m4/sys_socket_h.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/unistd-safer.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/vasnprintf.m4 \ $(top_srcdir)/gl/m4/vasprintf.m4 \ $(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \ - $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \ - $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \ + $(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ + $(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -108,28 +121,56 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) -am_test_base64_OBJECTS = test_base64-test_base64.$(OBJEXT) -test_base64_OBJECTS = $(am_test_base64_OBJECTS) -test_base64_DEPENDENCIES = $(top_srcdir)/gl/base64.o -am_test_cmd_OBJECTS = test_cmd-test_cmd.$(OBJEXT) -test_cmd_OBJECTS = $(am_test_cmd_OBJECTS) -test_cmd_DEPENDENCIES = ../utils_cmd.o ../utils_base.o -am_test_disk_OBJECTS = test_disk-test_disk.$(OBJEXT) -test_disk_OBJECTS = $(am_test_disk_OBJECTS) -test_disk_DEPENDENCIES = ../utils_disk.o $(top_srcdir)/gl/libgnu.a -am_test_ini_OBJECTS = test_ini-test_ini.$(OBJEXT) -test_ini_OBJECTS = $(am_test_ini_OBJECTS) -test_ini_DEPENDENCIES = ../utils_base.o ../parse_ini.o -am_test_opts_OBJECTS = test_opts-test_opts.$(OBJEXT) -test_opts_OBJECTS = $(am_test_opts_OBJECTS) -test_opts_DEPENDENCIES = ../utils_base.o ../parse_ini.o \ - ../extra_opts.o -am_test_tcp_OBJECTS = test_tcp-test_tcp.$(OBJEXT) -test_tcp_OBJECTS = $(am_test_tcp_OBJECTS) -test_tcp_DEPENDENCIES = ../utils_tcp.o -am_test_utils_OBJECTS = test_utils-test_utils.$(OBJEXT) -test_utils_OBJECTS = $(am_test_utils_OBJECTS) -test_utils_DEPENDENCIES = ../utils_base.o +test_base64_SOURCES = test_base64.c +test_base64_OBJECTS = test_base64.$(OBJEXT) +test_base64_LDADD = $(LDADD) +test_base64_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a +test_cmd_SOURCES = test_cmd.c +test_cmd_OBJECTS = test_cmd.$(OBJEXT) +test_cmd_LDADD = $(LDADD) +test_cmd_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a +test_disk_SOURCES = test_disk.c +test_disk_OBJECTS = test_disk.$(OBJEXT) +test_disk_LDADD = $(LDADD) +test_disk_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a +test_ini1_SOURCES = test_ini1.c +test_ini1_OBJECTS = test_ini1.$(OBJEXT) +test_ini1_LDADD = $(LDADD) +test_ini1_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a +test_ini3_SOURCES = test_ini3.c +test_ini3_OBJECTS = test_ini3.$(OBJEXT) +test_ini3_LDADD = $(LDADD) +test_ini3_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a +test_opts1_SOURCES = test_opts1.c +test_opts1_OBJECTS = test_opts1.$(OBJEXT) +test_opts1_LDADD = $(LDADD) +test_opts1_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a +test_opts2_SOURCES = test_opts2.c +test_opts2_OBJECTS = test_opts2.$(OBJEXT) +test_opts2_LDADD = $(LDADD) +test_opts2_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a +test_opts3_SOURCES = test_opts3.c +test_opts3_OBJECTS = test_opts3.$(OBJEXT) +test_opts3_LDADD = $(LDADD) +test_opts3_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a +test_tcp_SOURCES = test_tcp.c +test_tcp_OBJECTS = test_tcp.$(OBJEXT) +test_tcp_LDADD = $(LDADD) +test_tcp_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a +test_utils_SOURCES = test_utils.c +test_utils_OBJECTS = test_utils.$(OBJEXT) +test_utils_LDADD = $(LDADD) +test_utils_DEPENDENCIES = $(top_srcdir)/lib/libnagiosplug.a \ + $(top_srcdir)/gl/libgnu.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles @@ -141,12 +182,9 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(test_base64_SOURCES) $(test_cmd_SOURCES) \ - $(test_disk_SOURCES) $(test_ini_SOURCES) $(test_opts_SOURCES) \ - $(test_tcp_SOURCES) $(test_utils_SOURCES) -DIST_SOURCES = $(test_base64_SOURCES) $(test_cmd_SOURCES) \ - $(test_disk_SOURCES) $(test_ini_SOURCES) $(test_opts_SOURCES) \ - $(test_tcp_SOURCES) $(test_utils_SOURCES) +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 ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -157,6 +195,7 @@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ @@ -187,16 +226,24 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +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@ F77 = @F77@ +FCNTL_H = @FCNTL_H@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ @@ -205,47 +252,85 @@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPL = @GNULIB_FREXPL@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -255,18 +340,37 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_ROUND = @GNULIB_ROUND@ GNULIB_ROUNDF = @GNULIB_ROUNDF@ GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ @@ -279,32 +383,57 @@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ 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_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ @@ -317,25 +446,46 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_OS_H = @HAVE_OS_H@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ @@ -349,8 +499,16 @@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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@ @@ -358,14 +516,20 @@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +HOSTENT_LIB = @HOSTENT_LIB@ HOSTNAME = @HOSTNAME@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -383,10 +547,14 @@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ -LIBS = @LIBINTL@ +LIBS = @LTLIBINTL@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -399,15 +567,21 @@ MYSQLCFLAGS = @MYSQLCFLAGS@ MYSQLINCLUDE = @MYSQLINCLUDE@ MYSQLLIBS = @MYSQLLIBS@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_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@ @@ -449,16 +623,23 @@ PKG_ARCH = @PKG_ARCH@ PLUGIN_TEST = @PLUGIN_TEST@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PST3CFLAGS = @PST3CFLAGS@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ PYTHON = @PYTHON@ RADIUSLIBS = @RADIUSLIBS@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ +RELEASE_PRESENT_FALSE = @RELEASE_PRESENT_FALSE@ +RELEASE_PRESENT_TRUE = @RELEASE_PRESENT_TRUE@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -474,12 +655,28 @@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ +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_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -489,19 +686,32 @@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ 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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ REV_DATESTAMP = @REV_DATESTAMP@ REV_TIMESTAMP = @REV_TIMESTAMP@ SCRIPT_TEST = @SCRIPT_TEST@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ @@ -515,6 +725,11 @@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_LIBTAP_LOCAL_FALSE = @USE_LIBTAP_LOCAL_FALSE@ +USE_LIBTAP_LOCAL_TRUE = @USE_LIBTAP_LOCAL_TRUE@ USE_NLS = @USE_NLS@ USE_PARSE_INI_FALSE = @USE_PARSE_INI_FALSE@ USE_PARSE_INI_TRUE = @USE_PARSE_INI_TRUE@ @@ -586,37 +801,17 @@ with_trusted_path = @with_trusted_path@ # These two lines support "make check", but we use "make test" TESTS = @EXTRA_TEST@ INCLUDES = -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_ini.t test_opts.t test_tcp.t test_utils.t +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) -test_utils_SOURCES = test_utils.c -test_utils_CFLAGS = -g -I.. -test_utils_LDFLAGS = -L/usr/local/lib -ltap -test_utils_LDADD = ../utils_base.o -test_disk_SOURCES = test_disk.c -test_disk_CFLAGS = -g -I.. -test_disk_LDFLAGS = -L/usr/local/lib -ltap -test_disk_LDADD = ../utils_disk.o $(top_srcdir)/gl/libgnu.a -test_tcp_SOURCES = test_tcp.c -test_tcp_CFLAGS = -g -I.. -test_tcp_LDFLAGS = -L/usr/local/lib -ltap -test_tcp_LDADD = ../utils_tcp.o -test_cmd_SOURCES = test_cmd.c -test_cmd_CFLAGS = -g -I.. -test_cmd_LDFLAGS = -L/usr/local/lib -ltap -test_cmd_LDADD = ../utils_cmd.o ../utils_base.o -test_base64_SOURCES = test_base64.c -test_base64_CFLAGS = -g -I.. -test_base64_LDFLAGS = -L/usr/local/lib -ltap -test_base64_LDADD = $(top_srcdir)/gl/base64.o -test_ini_SOURCES = test_ini.c -test_ini_CFLAGS = -g -I.. -test_ini_LDFLAGS = -L/usr/local/lib -ltap -test_ini_LDADD = ../utils_base.o ../parse_ini.o -test_opts_SOURCES = test_opts.c -test_opts_CFLAGS = -g -I.. -test_opts_LDFLAGS = -L/usr/local/lib -ltap -test_opts_LDADD = ../utils_base.o ../parse_ini.o ../extra_opts.o +@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/libnagiosplug.a $(top_srcdir)/gl/libgnu.a +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: @@ -673,12 +868,21 @@ test_cmd$(EXEEXT): $(test_cmd_OBJECTS) $(test_cmd_DEPENDENCIES) test_disk$(EXEEXT): $(test_disk_OBJECTS) $(test_disk_DEPENDENCIES) @rm -f test_disk$(EXEEXT) $(LINK) $(test_disk_LDFLAGS) $(test_disk_OBJECTS) $(test_disk_LDADD) $(LIBS) -test_ini$(EXEEXT): $(test_ini_OBJECTS) $(test_ini_DEPENDENCIES) - @rm -f test_ini$(EXEEXT) - $(LINK) $(test_ini_LDFLAGS) $(test_ini_OBJECTS) $(test_ini_LDADD) $(LIBS) -test_opts$(EXEEXT): $(test_opts_OBJECTS) $(test_opts_DEPENDENCIES) - @rm -f test_opts$(EXEEXT) - $(LINK) $(test_opts_LDFLAGS) $(test_opts_OBJECTS) $(test_opts_LDADD) $(LIBS) +test_ini1$(EXEEXT): $(test_ini1_OBJECTS) $(test_ini1_DEPENDENCIES) + @rm -f test_ini1$(EXEEXT) + $(LINK) $(test_ini1_LDFLAGS) $(test_ini1_OBJECTS) $(test_ini1_LDADD) $(LIBS) +test_ini3$(EXEEXT): $(test_ini3_OBJECTS) $(test_ini3_DEPENDENCIES) + @rm -f test_ini3$(EXEEXT) + $(LINK) $(test_ini3_LDFLAGS) $(test_ini3_OBJECTS) $(test_ini3_LDADD) $(LIBS) +test_opts1$(EXEEXT): $(test_opts1_OBJECTS) $(test_opts1_DEPENDENCIES) + @rm -f test_opts1$(EXEEXT) + $(LINK) $(test_opts1_LDFLAGS) $(test_opts1_OBJECTS) $(test_opts1_LDADD) $(LIBS) +test_opts2$(EXEEXT): $(test_opts2_OBJECTS) $(test_opts2_DEPENDENCIES) + @rm -f test_opts2$(EXEEXT) + $(LINK) $(test_opts2_LDFLAGS) $(test_opts2_OBJECTS) $(test_opts2_LDADD) $(LIBS) +test_opts3$(EXEEXT): $(test_opts3_OBJECTS) $(test_opts3_DEPENDENCIES) + @rm -f test_opts3$(EXEEXT) + $(LINK) $(test_opts3_LDFLAGS) $(test_opts3_OBJECTS) $(test_opts3_LDADD) $(LIBS) test_tcp$(EXEEXT): $(test_tcp_OBJECTS) $(test_tcp_DEPENDENCIES) @rm -f test_tcp$(EXEEXT) $(LINK) $(test_tcp_LDFLAGS) $(test_tcp_OBJECTS) $(test_tcp_LDADD) $(LIBS) @@ -692,13 +896,16 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_base64-test_base64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cmd-test_cmd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_disk-test_disk.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ini-test_ini.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_opts-test_opts.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tcp-test_tcp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utils-test_utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_base64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_disk.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ini1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ini3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_opts1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_opts2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_opts3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utils.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @@ -721,104 +928,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -test_base64-test_base64.o: test_base64.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_base64_CFLAGS) $(CFLAGS) -MT test_base64-test_base64.o -MD -MP -MF "$(DEPDIR)/test_base64-test_base64.Tpo" -c -o test_base64-test_base64.o `test -f 'test_base64.c' || echo '$(srcdir)/'`test_base64.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_base64-test_base64.Tpo" "$(DEPDIR)/test_base64-test_base64.Po"; else rm -f "$(DEPDIR)/test_base64-test_base64.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_base64.c' object='test_base64-test_base64.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_base64_CFLAGS) $(CFLAGS) -c -o test_base64-test_base64.o `test -f 'test_base64.c' || echo '$(srcdir)/'`test_base64.c - -test_base64-test_base64.obj: test_base64.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_base64_CFLAGS) $(CFLAGS) -MT test_base64-test_base64.obj -MD -MP -MF "$(DEPDIR)/test_base64-test_base64.Tpo" -c -o test_base64-test_base64.obj `if test -f 'test_base64.c'; then $(CYGPATH_W) 'test_base64.c'; else $(CYGPATH_W) '$(srcdir)/test_base64.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_base64-test_base64.Tpo" "$(DEPDIR)/test_base64-test_base64.Po"; else rm -f "$(DEPDIR)/test_base64-test_base64.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_base64.c' object='test_base64-test_base64.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_base64_CFLAGS) $(CFLAGS) -c -o test_base64-test_base64.obj `if test -f 'test_base64.c'; then $(CYGPATH_W) 'test_base64.c'; else $(CYGPATH_W) '$(srcdir)/test_base64.c'; fi` - -test_cmd-test_cmd.o: test_cmd.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmd_CFLAGS) $(CFLAGS) -MT test_cmd-test_cmd.o -MD -MP -MF "$(DEPDIR)/test_cmd-test_cmd.Tpo" -c -o test_cmd-test_cmd.o `test -f 'test_cmd.c' || echo '$(srcdir)/'`test_cmd.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_cmd-test_cmd.Tpo" "$(DEPDIR)/test_cmd-test_cmd.Po"; else rm -f "$(DEPDIR)/test_cmd-test_cmd.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_cmd.c' object='test_cmd-test_cmd.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmd_CFLAGS) $(CFLAGS) -c -o test_cmd-test_cmd.o `test -f 'test_cmd.c' || echo '$(srcdir)/'`test_cmd.c - -test_cmd-test_cmd.obj: test_cmd.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmd_CFLAGS) $(CFLAGS) -MT test_cmd-test_cmd.obj -MD -MP -MF "$(DEPDIR)/test_cmd-test_cmd.Tpo" -c -o test_cmd-test_cmd.obj `if test -f 'test_cmd.c'; then $(CYGPATH_W) 'test_cmd.c'; else $(CYGPATH_W) '$(srcdir)/test_cmd.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_cmd-test_cmd.Tpo" "$(DEPDIR)/test_cmd-test_cmd.Po"; else rm -f "$(DEPDIR)/test_cmd-test_cmd.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_cmd.c' object='test_cmd-test_cmd.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmd_CFLAGS) $(CFLAGS) -c -o test_cmd-test_cmd.obj `if test -f 'test_cmd.c'; then $(CYGPATH_W) 'test_cmd.c'; else $(CYGPATH_W) '$(srcdir)/test_cmd.c'; fi` - -test_disk-test_disk.o: test_disk.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -MT test_disk-test_disk.o -MD -MP -MF "$(DEPDIR)/test_disk-test_disk.Tpo" -c -o test_disk-test_disk.o `test -f 'test_disk.c' || echo '$(srcdir)/'`test_disk.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_disk-test_disk.Tpo" "$(DEPDIR)/test_disk-test_disk.Po"; else rm -f "$(DEPDIR)/test_disk-test_disk.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_disk.c' object='test_disk-test_disk.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -c -o test_disk-test_disk.o `test -f 'test_disk.c' || echo '$(srcdir)/'`test_disk.c - -test_disk-test_disk.obj: test_disk.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -MT test_disk-test_disk.obj -MD -MP -MF "$(DEPDIR)/test_disk-test_disk.Tpo" -c -o test_disk-test_disk.obj `if test -f 'test_disk.c'; then $(CYGPATH_W) 'test_disk.c'; else $(CYGPATH_W) '$(srcdir)/test_disk.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_disk-test_disk.Tpo" "$(DEPDIR)/test_disk-test_disk.Po"; else rm -f "$(DEPDIR)/test_disk-test_disk.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_disk.c' object='test_disk-test_disk.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -c -o test_disk-test_disk.obj `if test -f 'test_disk.c'; then $(CYGPATH_W) 'test_disk.c'; else $(CYGPATH_W) '$(srcdir)/test_disk.c'; fi` - -test_ini-test_ini.o: test_ini.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ini_CFLAGS) $(CFLAGS) -MT test_ini-test_ini.o -MD -MP -MF "$(DEPDIR)/test_ini-test_ini.Tpo" -c -o test_ini-test_ini.o `test -f 'test_ini.c' || echo '$(srcdir)/'`test_ini.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_ini-test_ini.Tpo" "$(DEPDIR)/test_ini-test_ini.Po"; else rm -f "$(DEPDIR)/test_ini-test_ini.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_ini.c' object='test_ini-test_ini.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ini_CFLAGS) $(CFLAGS) -c -o test_ini-test_ini.o `test -f 'test_ini.c' || echo '$(srcdir)/'`test_ini.c - -test_ini-test_ini.obj: test_ini.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ini_CFLAGS) $(CFLAGS) -MT test_ini-test_ini.obj -MD -MP -MF "$(DEPDIR)/test_ini-test_ini.Tpo" -c -o test_ini-test_ini.obj `if test -f 'test_ini.c'; then $(CYGPATH_W) 'test_ini.c'; else $(CYGPATH_W) '$(srcdir)/test_ini.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_ini-test_ini.Tpo" "$(DEPDIR)/test_ini-test_ini.Po"; else rm -f "$(DEPDIR)/test_ini-test_ini.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_ini.c' object='test_ini-test_ini.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ini_CFLAGS) $(CFLAGS) -c -o test_ini-test_ini.obj `if test -f 'test_ini.c'; then $(CYGPATH_W) 'test_ini.c'; else $(CYGPATH_W) '$(srcdir)/test_ini.c'; fi` - -test_opts-test_opts.o: test_opts.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_opts_CFLAGS) $(CFLAGS) -MT test_opts-test_opts.o -MD -MP -MF "$(DEPDIR)/test_opts-test_opts.Tpo" -c -o test_opts-test_opts.o `test -f 'test_opts.c' || echo '$(srcdir)/'`test_opts.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_opts-test_opts.Tpo" "$(DEPDIR)/test_opts-test_opts.Po"; else rm -f "$(DEPDIR)/test_opts-test_opts.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_opts.c' object='test_opts-test_opts.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_opts_CFLAGS) $(CFLAGS) -c -o test_opts-test_opts.o `test -f 'test_opts.c' || echo '$(srcdir)/'`test_opts.c - -test_opts-test_opts.obj: test_opts.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_opts_CFLAGS) $(CFLAGS) -MT test_opts-test_opts.obj -MD -MP -MF "$(DEPDIR)/test_opts-test_opts.Tpo" -c -o test_opts-test_opts.obj `if test -f 'test_opts.c'; then $(CYGPATH_W) 'test_opts.c'; else $(CYGPATH_W) '$(srcdir)/test_opts.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_opts-test_opts.Tpo" "$(DEPDIR)/test_opts-test_opts.Po"; else rm -f "$(DEPDIR)/test_opts-test_opts.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_opts.c' object='test_opts-test_opts.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_opts_CFLAGS) $(CFLAGS) -c -o test_opts-test_opts.obj `if test -f 'test_opts.c'; then $(CYGPATH_W) 'test_opts.c'; else $(CYGPATH_W) '$(srcdir)/test_opts.c'; fi` - -test_tcp-test_tcp.o: test_tcp.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tcp_CFLAGS) $(CFLAGS) -MT test_tcp-test_tcp.o -MD -MP -MF "$(DEPDIR)/test_tcp-test_tcp.Tpo" -c -o test_tcp-test_tcp.o `test -f 'test_tcp.c' || echo '$(srcdir)/'`test_tcp.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_tcp-test_tcp.Tpo" "$(DEPDIR)/test_tcp-test_tcp.Po"; else rm -f "$(DEPDIR)/test_tcp-test_tcp.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_tcp.c' object='test_tcp-test_tcp.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tcp_CFLAGS) $(CFLAGS) -c -o test_tcp-test_tcp.o `test -f 'test_tcp.c' || echo '$(srcdir)/'`test_tcp.c - -test_tcp-test_tcp.obj: test_tcp.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tcp_CFLAGS) $(CFLAGS) -MT test_tcp-test_tcp.obj -MD -MP -MF "$(DEPDIR)/test_tcp-test_tcp.Tpo" -c -o test_tcp-test_tcp.obj `if test -f 'test_tcp.c'; then $(CYGPATH_W) 'test_tcp.c'; else $(CYGPATH_W) '$(srcdir)/test_tcp.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_tcp-test_tcp.Tpo" "$(DEPDIR)/test_tcp-test_tcp.Po"; else rm -f "$(DEPDIR)/test_tcp-test_tcp.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_tcp.c' object='test_tcp-test_tcp.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tcp_CFLAGS) $(CFLAGS) -c -o test_tcp-test_tcp.obj `if test -f 'test_tcp.c'; then $(CYGPATH_W) 'test_tcp.c'; else $(CYGPATH_W) '$(srcdir)/test_tcp.c'; fi` - -test_utils-test_utils.o: test_utils.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utils_CFLAGS) $(CFLAGS) -MT test_utils-test_utils.o -MD -MP -MF "$(DEPDIR)/test_utils-test_utils.Tpo" -c -o test_utils-test_utils.o `test -f 'test_utils.c' || echo '$(srcdir)/'`test_utils.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_utils-test_utils.Tpo" "$(DEPDIR)/test_utils-test_utils.Po"; else rm -f "$(DEPDIR)/test_utils-test_utils.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_utils.c' object='test_utils-test_utils.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utils_CFLAGS) $(CFLAGS) -c -o test_utils-test_utils.o `test -f 'test_utils.c' || echo '$(srcdir)/'`test_utils.c - -test_utils-test_utils.obj: test_utils.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utils_CFLAGS) $(CFLAGS) -MT test_utils-test_utils.obj -MD -MP -MF "$(DEPDIR)/test_utils-test_utils.Tpo" -c -o test_utils-test_utils.obj `if test -f 'test_utils.c'; then $(CYGPATH_W) 'test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_utils-test_utils.Tpo" "$(DEPDIR)/test_utils-test_utils.Po"; else rm -f "$(DEPDIR)/test_utils-test_utils.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_utils.c' object='test_utils-test_utils.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utils_CFLAGS) $(CFLAGS) -c -o test_utils-test_utils.obj `if test -f 'test_utils.c'; then $(CYGPATH_W) 'test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils.c'; fi` - mostlyclean-libtool: -rm -f *.lo diff --git a/lib/tests/plugin.ini b/lib/tests/plugin.ini index e22f8bd..511fd9f 100644 --- a/lib/tests/plugin.ini +++ b/lib/tests/plugin.ini @@ -1,7 +1,10 @@ +# Non-standard (but accepted) comment +; standard ini comment [check_mysql] username=operator -password=secret # Remember to change later +; comment in the middle +password=secret [section_twice] foo=bar diff --git a/lib/tests/plugins.ini b/lib/tests/plugins.ini index 5e20ded..6c2039f 100644 --- a/lib/tests/plugins.ini +++ b/lib/tests/plugins.ini @@ -5,3 +5,13 @@ 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 index 2325507..5103d10 100644 --- a/lib/tests/test_base64.c +++ b/lib/tests/test_base64.c @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: test_base64.c 1927 2008-02-13 04:07:39Z dermoth $ * *****************************************************************************/ diff --git a/lib/tests/test_cmd.c b/lib/tests/test_cmd.c index 961da64..29ca42a 100644 --- a/lib/tests/test_cmd.c +++ b/lib/tests/test_cmd.c @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id$ * *****************************************************************************/ diff --git a/lib/tests/test_disk.c b/lib/tests/test_disk.c index a30daae..58eb8f1 100644 --- a/lib/tests/test_disk.c +++ b/lib/tests/test_disk.c @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: test_disk.c 1914 2008-01-30 09:38:37Z dermoth $ * *****************************************************************************/ @@ -220,5 +219,6 @@ np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, i desc, regstr, expect, matches); } else - ok ( false, "regex '%s' not compileable", regstr); + ok ( false, "regex '%s' not compilable", regstr); } + diff --git a/lib/tests/test_ini.c b/lib/tests/test_ini1.c similarity index 72% rename from lib/tests/test_ini.c rename to lib/tests/test_ini1.c index 8acf4a9..77f8854 100644 --- a/lib/tests/test_ini.c +++ b/lib/tests/test_ini1.c @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: test_ini.c 1976 2008-04-04 10:11:22Z dermoth $ * *****************************************************************************/ @@ -55,7 +54,7 @@ main (int argc, char **argv) { char *optstr=NULL; - plan_tests(11); + 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"); @@ -65,14 +64,6 @@ main (int argc, char **argv) ok( !strcmp(optstr, "--one=two --Foo=Bar --this=Your Mother! --blank"), "Used default section name, without specific"); my_free(optstr); - /* - * This check is expected to die - It's commented so we can eventually put - * it in a separate file for testing the return value - */ - /* optstr=list2str(np_get_defaults("section_unknown@./config-tiny.ini", "section")); - ok( 0, "die if section isn't found"); - 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); @@ -109,6 +100,10 @@ main (int argc, char **argv) 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_ini.t b/lib/tests/test_ini1.t similarity index 75% rename from lib/tests/test_ini.t rename to lib/tests/test_ini1.t index 0487098..d481011 100755 --- a/lib/tests/test_ini.t +++ b/lib/tests/test_ini1.t @@ -1,6 +1,6 @@ #!/usr/bin/perl use Test::More; -if (! -e "./test_ini") { +if (! -e "./test_ini1") { plan skip_all => "./test_ini not compiled - please install tap library and/or enable parse-ini to test"; } -exec "./test_ini"; +exec "./test_ini1"; diff --git a/lib/tests/test_ini3.c b/lib/tests/test_ini3.c new file mode 100644 index 0000000..814b3ec --- /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 . +* +* +*****************************************************************************/ + +#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..4b0be4c --- /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 install tap library and/or enable parse-ini 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 trough 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_opts.c b/lib/tests/test_opts.c deleted file mode 100644 index e878abd..0000000 --- a/lib/tests/test_opts.c +++ /dev/null @@ -1,278 +0,0 @@ -/***************************************************************************** -* -* 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 . -* -* $Id: test_ini.c 1951 2008-03-16 18:10:47Z dermoth $ -* -*****************************************************************************/ - -#include "common.h" -#include "utils_base.h" -#include "extra_opts.h" - -#include "tap.h" - -void my_free(int *argc, char **argv) { - int i; - printf (" Arg(%i): ", *argc); - for (i=1; i<*argc; i++) printf ("'%s' ", argv[i]); - printf ("\n"); - free(argv); - *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_test=NULL, **argv_known=NULL; - int i, argc_test; - - plan_tests(9); - - argv_test=(char **)malloc(2*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = NULL; - argc_test=1; - argv_known=(char **)realloc(argv_known, 2*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); - ok(array_diff(argc_test, argv_test, 1, argv_known), "No opts, returns correct argv/argc"); - my_free(&argc_test, argv_test); - - argv_test=(char **)malloc(6*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "arg1"; - argv_test[2] = "--arg2=val1"; - argv_test[3] = "--arg3"; - argv_test[4] = "val2"; - argv_test[5] = NULL; - argc_test=5; - argv_known=(char **)realloc(argv_known, 6*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "arg1"; - argv_known[2] = "--arg2=val1"; - argv_known[3] = "--arg3"; - argv_known[4] = "val2"; - argv_known[5] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); - ok(array_diff(argc_test, argv_test, 5, argv_known), "No extra opts, verbatim copy of argv"); - my_free(&argc_test,argv_test); - - argv_test=(char **)malloc(3*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "--extra-opts=@./config-opts.ini"; - argv_test[2] = NULL; - argc_test=2; - argv_known=(char **)realloc(argv_known, 5*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "--foo=Bar"; - argv_known[2] = "--this=Your Mother!"; - argv_known[3] = "--blank"; - argv_known[4] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); - ok(array_diff(argc_test, argv_test, 4, argv_known), "Only extra opts using default section"); - my_free(&argc_test,argv_test); - - argv_test=(char **)malloc(5*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "--extra-opts=sect1@./config-opts.ini"; - argv_test[2] = "--extra-opts"; - argv_test[3] = "sect2@./config-opts.ini"; - argv_test[4] = NULL; - argc_test=4; - argv_known=(char **)realloc(argv_known, 5*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "--one=two"; - argv_known[2] = "--something else=oops"; - argv_known[3] = "--this=that"; - argv_known[4] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); - ok(array_diff(argc_test, argv_test, 4, argv_known), "Only extra opts specified twice"); - my_free(&argc_test,argv_test); - - argv_test=(char **)malloc(7*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "--arg1=val1"; - argv_test[2] = "--extra-opts=@./config-opts.ini"; - argv_test[3] = "--extra-opts"; - argv_test[4] = "sect1@./config-opts.ini"; - argv_test[5] = "--arg2"; - argv_test[6] = NULL; - argc_test=6; - argv_known=(char **)realloc(argv_known, 8*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "--foo=Bar"; - argv_known[2] = "--this=Your Mother!"; - argv_known[3] = "--blank"; - argv_known[4] = "--one=two"; - argv_known[5] = "--arg1=val1"; - argv_known[6] = "--arg2"; - argv_known[7] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); - ok(array_diff(argc_test, argv_test, 7, argv_known), "twice extra opts using two sections"); - my_free(&argc_test,argv_test); - - /* Next three checks dre expected to die. They are commented out as they - * could possibly go in a sepatare test checked for return value. - */ - /* argv_test=(char **)malloc(6*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "arg1"; - argv_test[2] = "--extra-opts=missing@./config-opts.ini"; - argv_test[3] = "--arg3"; - argv_test[4] = "val2"; - argv_test[5] = NULL; - argc_test=5; - argv_known=(char **)realloc(argv_known, 5*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "arg1"; - argv_known[2] = "--arg3"; - argv_known[3] = "val2"; - argv_known[4] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_missing"); - ok(array_diff(argc_test, argv_test, 4, argv_known), "Missing section 1"); - my_free(&argc_test,argv_test); */ - - /* argv_test=(char **)malloc(7*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "arg1"; - argv_test[2] = "--extra-opts"; - argv_test[3] = "missing@./config-opts.ini"; - argv_test[4] = "--arg3"; - argv_test[5] = "val2"; - argv_test[6] = NULL; - argc_test=6; - argv_known=(char **)realloc(argv_known, 5*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "arg1"; - argv_known[2] = "--arg3"; - argv_known[3] = "val2"; - argv_known[4] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_missing"); - ok(array_diff(argc_test, argv_test, 4, argv_known), "Missing section 2"); - my_free(&argc_test,argv_test); */ - - /* argv_test=(char **)malloc(6*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "arg1"; - argv_test[2] = "--extra-opts"; - argv_test[3] = "--arg3"; - argv_test[4] = "val2"; - argv_test[5] = NULL; - argc_test=5; - argv_known=(char **)realloc(argv_known, 5*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "arg1"; - argv_known[2] = "--arg3"; - argv_known[3] = "val2"; - argv_known[4] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_missing"); - ok(array_diff(argc_test, argv_test, 4, argv_known), "Missing section 3"); - my_free(&argc_test,argv_test); */ - - setenv("NAGIOS_CONFIG_PATH", ".", 1); - argv_test=(char **)malloc(6*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "arg1"; - argv_test[2] = "--extra-opts"; - argv_test[3] = "--arg3"; - argv_test[4] = "val2"; - argv_test[5] = NULL; - argc_test=5; - argv_known=(char **)realloc(argv_known, 6*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "--foo=bar"; - argv_known[2] = "arg1"; - argv_known[3] = "--arg3"; - argv_known[4] = "val2"; - argv_known[5] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); - ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 1"); - - argv_test=(char **)malloc(3*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "--extra-opts"; - argv_test[2] = NULL; - argc_test=2; - argv_known=(char **)realloc(argv_known, 3*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "--foo=bar"; - argv_known[2] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); - ok(array_diff(argc_test, argv_test, 2, argv_known), "Default section 2"); - my_free(&argc_test,argv_test); - - argv_test=(char **)malloc(6*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "arg1"; - argv_test[2] = "--extra-opts=section1"; - argv_test[3] = "--arg3"; - argv_test[4] = "val2"; - argv_test[5] = NULL; - argc_test=5; - argv_known=(char **)realloc(argv_known, 6*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "--foobar=baz"; - argv_known[2] = "arg1"; - argv_known[3] = "--arg3"; - argv_known[4] = "val2"; - argv_known[5] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); - ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 3"); - my_free(&argc_test,argv_test); - - argv_test=(char **)malloc(6*sizeof(char **)); - argv_test[0] = "prog_name"; - argv_test[1] = "arg1"; - argv_test[2] = "--extra-opts"; - argv_test[3] = "-arg3"; - argv_test[4] = "val2"; - argv_test[5] = NULL; - argc_test=5; - argv_known=(char **)realloc(argv_known, 6*sizeof(char **)); - argv_known[0] = "prog_name"; - argv_known[1] = "--foo=bar"; - argv_known[2] = "arg1"; - argv_known[3] = "-arg3"; - argv_known[4] = "val2"; - argv_known[5] = NULL; - argv_test=np_extra_opts(&argc_test, argv_test, "check_disk"); - ok(array_diff(argc_test, argv_test, 5, argv_known), "Default section 4"); - my_free(&argc_test,argv_test); - - return exit_status(); -} - diff --git a/lib/tests/test_opts.t b/lib/tests/test_opts.t deleted file mode 100755 index d69b8f1..0000000 --- a/lib/tests/test_opts.t +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/perl -use Test::More; -if (! -e "./test_opts") { - plan skip_all => "./test_opts not compiled - please install tap library and/or enable parse-ini to test"; -} -exec "./test_opts"; 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 . +* +*****************************************************************************/ + +#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..52eed94 --- /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 install tap library and/or enable parse-ini 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..c3d2067 --- /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 . +* +*****************************************************************************/ + +#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..f7444f6 --- /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 install tap library and/or enable parse-ini 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 . +* +*****************************************************************************/ + +#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..fa7876d --- /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 install tap library and/or enable parse-ini 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 trough 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 index 0e0dad1..6cf9394 100644 --- a/lib/tests/test_tcp.c +++ b/lib/tests/test_tcp.c @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: test_tcp.c 1914 2008-01-30 09:38:37Z dermoth $ * *****************************************************************************/ diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c index ea38411..3a45944 100644 --- a/lib/tests/test_utils.c +++ b/lib/tests/test_utils.c @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: test_utils.c 1914 2008-01-30 09:38:37Z dermoth $ * *****************************************************************************/ @@ -30,7 +29,7 @@ main (int argc, char **argv) thresholds *thresholds = NULL; int rc; - plan_tests(82); + plan_tests(81+23); range = parse_range_string("6"); ok( range != NULL, "'6' is valid range"); @@ -172,10 +171,85 @@ main (int argc, char **argv) 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 = basename("/here/is/a/path"); - ok( strcmp(test, "path") == 0, "basename okay"); + 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"); return exit_status(); } diff --git a/lib/utils_base.c b/lib/utils_base.c index 467edf7..4303e15 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 2006 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-03-11 00:10:23 +0000 (Tue, 11 Mar 2008) $ -* * Library of useful functions for plugins * * @@ -23,7 +21,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: utils_base.c 1938 2008-03-11 00:10:23Z tonvoon $ * *****************************************************************************/ @@ -89,7 +86,7 @@ range set_range_end(temp_range, end); } - if (temp_range->start_infinity == TRUE || + if (temp_range->start_infinity == TRUE || temp_range->end_infinity == TRUE || temp_range->start <= temp_range->end) { return temp_range; @@ -104,7 +101,9 @@ _set_thresholds(thresholds **my_thresholds, char *warn_string, char *critical_st { thresholds *temp_thresholds = NULL; - temp_thresholds = malloc(sizeof(temp_thresholds)); + if ((temp_thresholds = malloc(sizeof(thresholds))) == NULL) + die(STATE_UNKNOWN, _("Cannot allocate memory: %s\n"), + strerror(errno)); temp_thresholds->warning = NULL; temp_thresholds->critical = NULL; @@ -164,7 +163,7 @@ check_range(double value, range *my_range) { int no = FALSE; int yes = TRUE; - + if (my_range->alert_on == INSIDE) { no = TRUE; yes = FALSE; @@ -254,3 +253,60 @@ int np_warn_if_not_root(void) { } return status; } + +/* + * 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 (varlist; isspace(varlist[0]); varlist++); + + if (strncmp(name, varlist, strlen(name)) == 0) { + varlist += strlen(name); + /* strip trailing spaces */ + for (varlist; isspace(varlist[0]); varlist++); + + if (varlist[0] == '=') { + /* We matched the key, go past the = sign */ + varlist++; + /* strip leading spaces */ + for (varlist; isspace(varlist[0]); varlist++); + + if (tmp = index(varlist, sep)) { + /* Value is delimited by a comma */ + if (tmp-varlist == 0) continue; + value = (char *)malloc(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 *)malloc(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; +} + diff --git a/lib/utils_base.h b/lib/utils_base.h index bda7659..49e40a6 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h @@ -35,6 +35,9 @@ void print_thresholds(const char *, thresholds *); int check_range(double, range *); int get_status(double, thresholds *); +/* 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))); @@ -50,4 +53,18 @@ int np_check_if_root(void); * code from the above function, in case it's helpful for testing */ int np_warn_if_not_root(void); +/* + * 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, ',') + #endif /* _UTILS_BASE_ */ diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c index aaf055a..e10ab91 100644 --- a/lib/utils_cmd.c +++ b/lib/utils_cmd.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 2005-2006 Nagios Plugins Development Team * -* Last Modified: $Date$ -* * Description : * * A simple interface to executing programs from other programs, using an @@ -35,7 +33,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id$ * *****************************************************************************/ @@ -45,6 +42,7 @@ #include "common.h" #include "utils_cmd.h" #include "utils_base.h" +#include #ifdef HAVE_SYS_WAIT_H # include @@ -377,3 +375,20 @@ cmd_run_array (char *const *argv, output * out, output * err, int 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); + + return 0; +} diff --git a/lib/utils_cmd.h b/lib/utils_cmd.h index d54b2b4..8ebb589 100644 --- a/lib/utils_cmd.h +++ b/lib/utils_cmd.h @@ -22,6 +22,7 @@ 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); diff --git a/lib/utils_disk.c b/lib/utils_disk.c index 113db7e..3d20f4d 100644 --- a/lib/utils_disk.c +++ b/lib/utils_disk.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 1999-2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-01-30 09:46:21 +0000 (Wed, 30 Jan 2008) $ -* * Description: * * This file contains utilities for check_disk. These are tested by libtap @@ -25,7 +23,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: utils_disk.c 1915 2008-01-30 09:46:21Z dermoth $ * *****************************************************************************/ @@ -77,22 +74,21 @@ np_add_parameter(struct parameter_list **list, const char *name) struct parameter_list * np_del_parameter(struct parameter_list *item, struct parameter_list *prev) { - struct parameter_list *next; - if (item->name_next) - next = item->name_next; - else - next = NULL; + struct parameter_list *next; - - free(item); - if (prev) - prev->name_next = next; + if (item->name_next) + next = item->name_next; + else + next = NULL; - return next; + free(item); + if (prev) + prev->name_next = next; + 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) @@ -102,7 +98,7 @@ np_find_parameter(struct parameter_list *list, const char *name) if (! strcmp(temp_list->name, name)) return temp_list; } - + return NULL; } @@ -127,7 +123,7 @@ np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list if (! best_match) { for (me = mount_list; me; me = me->me_next) { size_t len = strlen (me->me_mountdir); - if ((exact == FALSE && (best_match_len <= len && len <= name_len && + if ((exact == FALSE && (best_match_len <= len && len <= name_len && (len == 1 || strncmp (me->me_mountdir, d->name, len) == 0))) || (exact == TRUE && strcmp(me->me_mountdir, d->name)==0)) { @@ -176,7 +172,7 @@ np_seen_name(struct name_list *list, const char *name) } int -np_regex_match_mount_entry (struct mount_entry* me, regex_t* re) +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 ) { diff --git a/lib/utils_tcp.c b/lib/utils_tcp.c index 8b6b9e9..8589ce6 100644 --- a/lib/utils_tcp.c +++ b/lib/utils_tcp.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 1999-2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-01-30 09:46:21 +0000 (Wed, 30 Jan 2008) $ -* * Description: * * This file contains utilities for check_tcp. These are tested by libtap @@ -25,7 +23,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: utils_tcp.c 1915 2008-01-30 09:46:21Z dermoth $ * *****************************************************************************/ diff --git a/nagios-plugins.spec b/nagios-plugins.spec index 36fa1f9..f58d1e0 100644 --- a/nagios-plugins.spec +++ b/nagios-plugins.spec @@ -1,6 +1,6 @@ Name: nagios-plugins -Version: 1.4.12 -Release: 1 +Version: trunk-200906171200 +Release: snapshot Summary: Host/service/network monitoring program plugins for Nagios Group: Applications/System diff --git a/perlmods/Makefile b/perlmods/Makefile index 1e189cf..f9b3c49 100644 --- a/perlmods/Makefile +++ b/perlmods/Makefile @@ -38,17 +38,19 @@ subdir = perlmods DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ - $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ - $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \ - $(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \ - $(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \ + $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \ + $(top_srcdir)/gl/m4/dos.m4 \ $(top_srcdir)/gl/m4/double-slash-root.m4 \ - $(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \ + $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \ $(top_srcdir)/gl/m4/exitfail.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-safer.m4 \ - $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \ + $(top_srcdir)/gl/m4/floorf.m4 \ $(top_srcdir)/gl/m4/fstypename.m4 \ $(top_srcdir)/gl/m4/fsusage.m4 \ $(top_srcdir)/gl/m4/getaddrinfo.m4 \ @@ -58,7 +60,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/glibc21.m4 \ $(top_srcdir)/gl/m4/gnulib-common.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ - $(top_srcdir)/gl/m4/iconv.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/iconv.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \ $(top_srcdir)/gl/m4/intlmacosx.m4 \ @@ -67,17 +69,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \ $(top_srcdir)/gl/m4/lib-prefix.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/longlong.m4 \ $(top_srcdir)/gl/m4/ls-mntd-fs.m4 \ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \ $(top_srcdir)/gl/m4/mountlist.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/nls.m4 \ - $(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \ + $(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \ $(top_srcdir)/gl/m4/safe-read.m4 \ $(top_srcdir)/gl/m4/safe-write.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \ $(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \ @@ -87,13 +96,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \ $(top_srcdir)/gl/m4/strnlen.m4 \ $(top_srcdir)/gl/m4/sys_socket_h.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/unistd-safer.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/vasnprintf.m4 \ $(top_srcdir)/gl/m4/vasprintf.m4 \ $(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \ - $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \ - $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \ + $(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ + $(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -105,17 +117,18 @@ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INSTALL = /usr/bin/install -c -ACLOCAL = ${SHELL} /tmp/nagiosplug/build-aux/missing --run aclocal-1.9 +ACLOCAL = ${SHELL} /tmp/tonvoon/tmp_snapshot/trunk/nagiosplug/build-aux/missing --run aclocal-1.9 ALLOCA = ALLOCA_H = alloca.h AMDEP_FALSE = # AMDEP_TRUE = -AMTAR = ${SHELL} /tmp/nagiosplug/build-aux/missing --run tar +AMTAR = ${SHELL} /tmp/tonvoon/tmp_snapshot/trunk/nagiosplug/build-aux/missing --run tar +APPLE_UNIVERSAL_BUILD = 0 AR = ar -ARPA_INET_H = -AUTOCONF = ${SHELL} /tmp/nagiosplug/build-aux/missing --run autoconf -AUTOHEADER = ${SHELL} /tmp/nagiosplug/build-aux/missing --run autoheader -AUTOMAKE = ${SHELL} /tmp/nagiosplug/build-aux/missing --run automake-1.9 +ARPA_INET_H = arpa/inet.h +AUTOCONF = ${SHELL} /tmp/tonvoon/tmp_snapshot/trunk/nagiosplug/build-aux/missing --run autoconf +AUTOHEADER = ${SHELL} /tmp/tonvoon/tmp_snapshot/trunk/nagiosplug/build-aux/missing --run autoheader +AUTOMAKE = ${SHELL} /tmp/tonvoon/tmp_snapshot/trunk/nagiosplug/build-aux/missing --run automake-1.9 AWK = mawk BASENAME = /usr/bin/basename BITSIZEOF_PTRDIFF_T = 32 @@ -141,16 +154,24 @@ ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E -EOVERFLOW = +EMULTIHOP_HIDDEN = +EMULTIHOP_VALUE = +ENOLINK_HIDDEN = +ENOLINK_VALUE = +EOVERFLOW_HIDDEN = +EOVERFLOW_VALUE = +ERRNO_H = EXEEXT = EXTRAS = check_ldap check_ide_smart check_procs check_nagios check_dns check_by_ssh check_swap check_dig check_apt check_nt EXTRAS_ROOT = EXTRA_NETOBJS = EXTRA_TEST = F77 = +FCNTL_H = fcntl.h FFLAGS = FLOAT_H = FLOORF_LIBM = -lm +GETADDRINFO_LIB = GETLOADAVG_LIBS = GETOPT_H = GETTEXT_MACRO_VERSION = 0.17 @@ -159,47 +180,85 @@ GL_COND_LIBTOOL_FALSE = GL_COND_LIBTOOL_TRUE = # GMSGFMT = /usr/bin/msgfmt GMSGFMT_015 = /usr/bin/msgfmt +GNULIB_ACCEPT = 0 +GNULIB_ATOLL = 0 +GNULIB_BIND = 0 +GNULIB_BTOWC = 1 GNULIB_CALLOC_POSIX = 0 GNULIB_CEILF = 0 GNULIB_CEILL = 0 GNULIB_CHOWN = 0 +GNULIB_CLOSE = 0 +GNULIB_CONNECT = 0 +GNULIB_DPRINTF = 0 GNULIB_DUP2 = 0 +GNULIB_ENVIRON = 0 +GNULIB_EUIDACCESS = 0 GNULIB_FCHDIR = 0 +GNULIB_FCLOSE = 0 GNULIB_FFLUSH = 0 GNULIB_FLOORF = 1 GNULIB_FLOORL = 0 GNULIB_FOPEN = 0 +GNULIB_FPRINTF = 1 GNULIB_FPRINTF_POSIX = 0 +GNULIB_FPUTC = 1 +GNULIB_FPUTS = 1 GNULIB_FREOPEN = 0 GNULIB_FREXP = 0 GNULIB_FREXPL = 0 GNULIB_FSEEK = 0 GNULIB_FSEEKO = 0 +GNULIB_FSYNC = 0 GNULIB_FTELL = 0 GNULIB_FTELLO = 0 GNULIB_FTRUNCATE = 0 +GNULIB_FWRITE = 1 +GNULIB_GETADDRINFO = 1 GNULIB_GETCWD = 0 GNULIB_GETDELIM = 0 +GNULIB_GETDOMAINNAME = 0 +GNULIB_GETDTABLESIZE = 0 +GNULIB_GETHOSTNAME = 1 GNULIB_GETLINE = 0 +GNULIB_GETLOADAVG = 1 GNULIB_GETLOGIN_R = 0 GNULIB_GETPAGESIZE = 0 +GNULIB_GETPEERNAME = 0 +GNULIB_GETSOCKNAME = 0 +GNULIB_GETSOCKOPT = 0 GNULIB_GETSUBOPT = 0 +GNULIB_GETUSERSHELL = 0 +GNULIB_INET_NTOP = 1 +GNULIB_INET_PTON = 0 GNULIB_ISFINITE = 0 +GNULIB_ISINF = 0 +GNULIB_ISNAN = 0 +GNULIB_ISNAND = 0 +GNULIB_ISNANF = 0 +GNULIB_ISNANL = 0 GNULIB_LCHOWN = 0 GNULIB_LDEXPL = 0 +GNULIB_LINK = 0 +GNULIB_LISTEN = 0 GNULIB_LSEEK = 0 GNULIB_MALLOC_POSIX = 1 GNULIB_MATHL = 0 +GNULIB_MBRLEN = 0 +GNULIB_MBRTOWC = 1 GNULIB_MBSCASECMP = 0 GNULIB_MBSCASESTR = 0 GNULIB_MBSCHR = 0 GNULIB_MBSCSPN = 0 +GNULIB_MBSINIT = 1 GNULIB_MBSLEN = 0 GNULIB_MBSNCASECMP = 0 GNULIB_MBSNLEN = 0 +GNULIB_MBSNRTOWCS = 0 GNULIB_MBSPBRK = 0 GNULIB_MBSPCASECMP = 0 GNULIB_MBSRCHR = 0 +GNULIB_MBSRTOWCS = 0 GNULIB_MBSSEP = 0 GNULIB_MBSSPN = 0 GNULIB_MBSSTR = 0 @@ -209,18 +268,37 @@ GNULIB_MEMPCPY = 0 GNULIB_MEMRCHR = 0 GNULIB_MKDTEMP = 0 GNULIB_MKSTEMP = 0 +GNULIB_OBSTACK_PRINTF = 0 +GNULIB_OBSTACK_PRINTF_POSIX = 0 +GNULIB_OPEN = 1 +GNULIB_PERROR = 0 +GNULIB_PRINTF = 1 GNULIB_PRINTF_POSIX = 0 +GNULIB_PUTC = 1 +GNULIB_PUTCHAR = 1 GNULIB_PUTENV = 0 +GNULIB_PUTS = 1 +GNULIB_RANDOM_R = 0 +GNULIB_RAWMEMCHR = 0 GNULIB_READLINK = 0 GNULIB_REALLOC_POSIX = 0 +GNULIB_RECV = 0 +GNULIB_RECVFROM = 0 GNULIB_ROUND = 0 GNULIB_ROUNDF = 0 GNULIB_ROUNDL = 0 +GNULIB_RPMATCH = 0 +GNULIB_SEND = 0 +GNULIB_SENDTO = 0 GNULIB_SETENV = 0 +GNULIB_SETSOCKOPT = 0 +GNULIB_SHUTDOWN = 0 GNULIB_SIGNBIT = 0 GNULIB_SLEEP = 0 GNULIB_SNPRINTF = 1 +GNULIB_SOCKET = 0 GNULIB_SPRINTF_POSIX = 0 +GNULIB_STDIO_H_SIGPIPE = 0 GNULIB_STPCPY = 0 GNULIB_STPNCPY = 0 GNULIB_STRCASESTR = 0 @@ -233,32 +311,57 @@ GNULIB_STRPBRK = 0 GNULIB_STRSEP = 0 GNULIB_STRSIGNAL = 0 GNULIB_STRSTR = 0 +GNULIB_STRTOD = 0 GNULIB_STRTOK_R = 0 +GNULIB_STRTOLL = 0 +GNULIB_STRTOULL = 0 +GNULIB_STRVERSCMP = 0 GNULIB_TRUNC = 0 GNULIB_TRUNCF = 0 GNULIB_TRUNCL = 0 +GNULIB_UNISTD_H_SIGPIPE = 0 GNULIB_UNSETENV = 0 GNULIB_VASPRINTF = 1 +GNULIB_VDPRINTF = 0 +GNULIB_VFPRINTF = 1 GNULIB_VFPRINTF_POSIX = 0 +GNULIB_VPRINTF = 1 GNULIB_VPRINTF_POSIX = 0 GNULIB_VSNPRINTF = 1 GNULIB_VSPRINTF_POSIX = 0 +GNULIB_WCRTOMB = 1 +GNULIB_WCSNRTOMBS = 0 +GNULIB_WCSRTOMBS = 0 +GNULIB_WCTOB = 0 GNULIB_WCWIDTH = 0 +GNULIB_WRITE = 1 GREP = /bin/grep +HAVE_ARPA_INET_H = 1 +HAVE_ATOLL = 1 +HAVE_BTOWC = 1 HAVE_CALLOC_POSIX = 1 HAVE_DECL_ACOSL = 1 HAVE_DECL_ASINL = 1 HAVE_DECL_ATANL = 1 HAVE_DECL_COSL = 1 +HAVE_DECL_ENVIRON = 1 HAVE_DECL_EXPL = 1 +HAVE_DECL_FREEADDRINFO = 1 HAVE_DECL_FREXPL = 1 +HAVE_DECL_GAI_STRERROR = 1 +HAVE_DECL_GETADDRINFO = 1 HAVE_DECL_GETDELIM = 1 HAVE_DECL_GETLINE = 1 +HAVE_DECL_GETLOADAVG = 1 HAVE_DECL_GETLOGIN_R = 1 +HAVE_DECL_GETNAMEINFO = 1 +HAVE_DECL_INET_NTOP = 1 +HAVE_DECL_INET_PTON = 1 HAVE_DECL_LDEXPL = 1 HAVE_DECL_LOGL = 1 HAVE_DECL_MEMMEM = 1 HAVE_DECL_MEMRCHR = 1 +HAVE_DECL_OBSTACK_PRINTF = 1 HAVE_DECL_SINL = 1 HAVE_DECL_SNPRINTF = 1 HAVE_DECL_SQRTL = 1 @@ -271,25 +374,46 @@ HAVE_DECL_STRTOK_R = 1 HAVE_DECL_TANL = 1 HAVE_DECL_TRUNC = 1 HAVE_DECL_TRUNCF = 1 -HAVE_DECL_TRUNCL = 1 HAVE_DECL_VSNPRINTF = 1 +HAVE_DECL_WCTOB = 1 HAVE_DECL_WCWIDTH = 1 +HAVE_DPRINTF = 1 HAVE_DUP2 = 1 +HAVE_EUIDACCESS = 1 HAVE_FSEEKO = 1 +HAVE_FSYNC = 1 HAVE_FTELLO = 1 HAVE_FTRUNCATE = 1 +HAVE_GETDOMAINNAME = 1 +HAVE_GETDTABLESIZE = 1 +HAVE_GETHOSTNAME = 1 HAVE_GETPAGESIZE = 1 HAVE_GETSUBOPT = 1 +HAVE_GETUSERSHELL = 1 HAVE_INTTYPES_H = 1 +HAVE_ISNAND = 1 +HAVE_ISNANF = 1 +HAVE_ISNANL = 1 HAVE_ISWCNTRL = 1 +HAVE_LINK = 1 HAVE_LONG_LONG_INT = 1 HAVE_MALLOC_POSIX = 1 +HAVE_MBRLEN = 1 +HAVE_MBRTOWC = 1 +HAVE_MBSINIT = 1 +HAVE_MBSNRTOWCS = 1 +HAVE_MBSRTOWCS = 1 HAVE_MEMPCPY = 1 HAVE_MKDTEMP = 1 +HAVE_NETDB_H = 1 HAVE_NETINET_IN_H = HAVE_OS_H = 0 +HAVE_RANDOM_H = 0 +HAVE_RANDOM_R = 1 +HAVE_RAWMEMCHR = 1 HAVE_READLINK = 1 HAVE_REALLOC_POSIX = 1 +HAVE_RPMATCH = 1 HAVE_SETENV = 1 HAVE_SIGNED_SIG_ATOMIC_T = 1 HAVE_SIGNED_WCHAR_T = 1 @@ -303,23 +427,37 @@ HAVE_STRCHRNUL = 1 HAVE_STRNDUP = 1 HAVE_STRPBRK = 1 HAVE_STRSEP = 1 +HAVE_STRTOD = 1 +HAVE_STRTOLL = 1 +HAVE_STRTOULL = 1 +HAVE_STRUCT_ADDRINFO = 1 +HAVE_STRUCT_RANDOM_DATA = 1 +HAVE_STRUCT_SOCKADDR_STORAGE = 1 +HAVE_STRVERSCMP = 1 HAVE_SYS_BITYPES_H = 1 HAVE_SYS_INTTYPES_H = 0 +HAVE_SYS_LOADAVG_H = 0 HAVE_SYS_PARAM_H = 0 -HAVE_SYS_SOCKET_H = +HAVE_SYS_SOCKET_H = 1 HAVE_SYS_TYPES_H = 1 HAVE_UNISTD_H = 1 HAVE_UNSETENV = 1 HAVE_UNSIGNED_LONG_LONG_INT = 1 HAVE_VASPRINTF = 1 +HAVE_VDPRINTF = 1 HAVE_WCHAR_H = 1 +HAVE_WCRTOMB = 1 +HAVE_WCSNRTOMBS = 1 +HAVE_WCSRTOMBS = 1 HAVE_WCTYPE_H = 1 -HAVE_WINSOCK2_H = +HAVE_WINSOCK2_H = 0 HAVE_WINT_T = 1 -HAVE_WS2TCPIP_H = +HAVE_WS2TCPIP_H = 0 HAVE__BOOL = 1 +HOSTENT_LIB = HOSTNAME = /bin/hostname INCLUDE_NEXT = include_next +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = include_next INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} @@ -337,14 +475,18 @@ LIBGNU_LTLIBDEPS = LIBICONV = -liconv LIBINTL = LIBOBJS = -LIBS = -ldl +LIBS = -lpthread -ldl LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s LOCALCHARSET_TESTS_ENVIRONMENT = CHARSETALIASDIR="$(top_builddir)/gl" +LOCALE_FR = none +LOCALE_FR_UTF8 = none +LOCALE_JA = none +LOCALE_ZH_CN = none LTLIBICONV = -liconv LTLIBINTL = LTLIBOBJS = -MAKEINFO = ${SHELL} /tmp/nagiosplug/build-aux/missing --run makeinfo +MAKEINFO = ${SHELL} /tmp/tonvoon/tmp_snapshot/trunk/nagiosplug/build-aux/missing --run makeinfo MATHLIBS = -lm MSGFMT = /usr/bin/msgfmt MSGFMT_015 = /usr/bin/msgfmt @@ -353,15 +495,21 @@ MYSQLCFLAGS = MYSQLINCLUDE = MYSQLLIBS = NEED_SETGID = false +NETDB_H = NETINET_IN_H = +NEXT_ARPA_INET_H = +NEXT_ERRNO_H = +NEXT_FCNTL_H = NEXT_FLOAT_H = NEXT_MATH_H = +NEXT_NETDB_H = NEXT_NETINET_IN_H = NEXT_STDINT_H = NEXT_STDIO_H = NEXT_STDLIB_H = NEXT_STRING_H = -NEXT_SYS_SOCKET_H = +NEXT_SYS_SOCKET_H = +NEXT_TIME_H = NEXT_UNISTD_H = NEXT_WCHAR_H = NEXT_WCTYPE_H = @@ -369,9 +517,9 @@ OBJEXT = o PACKAGE = nagios-plugins PACKAGE_BUGREPORT = PACKAGE_NAME = nagios-plugins -PACKAGE_STRING = nagios-plugins 1.4.12 +PACKAGE_STRING = nagios-plugins 1.4.13 PACKAGE_TARNAME = nagios-plugins -PACKAGE_VERSION = 1.4.12 +PACKAGE_VERSION = 1.4.13 PATH_SEPARATOR = : PATH_TO_APTGET = /usr/bin/apt-get PATH_TO_DIG = /usr/bin/dig @@ -400,19 +548,26 @@ PERLMODS_DIR = PGINCLUDE = PGLIBS = PKG_ARCH = unknown -PLUGIN_TEST = t/check_by_ssh.t t/check_cluster.t t/check_disk.t t/check_dns.t t/check_dummy.t t/check_fping.t t/check_ftp.t t/check_hpjd.t t/check_http.t t/check_imap.t t/check_jabber.t t/check_load.t t/check_mysql.t t/check_mysql_query.t t/check_nagios.t t/check_ntp.t t/check_ping.t t/check_pop.t t/check_procs.t t/check_smtp.t t/check_snmp.t t/check_swap.t t/check_tcp.t t/check_time.t t/check_udp.t t/check_users.t t/negate.t +PLUGIN_TEST = t/check_by_ssh.t t/check_cluster.t t/check_dig.t t/check_disk.t t/check_dns.t t/check_dummy.t t/check_fping.t t/check_ftp.t t/check_hpjd.t t/check_http.t t/check_imap.t t/check_jabber.t t/check_load.t t/check_mysql.t t/check_mysql_query.t t/check_nagios.t t/check_ntp.t t/check_ping.t t/check_pop.t t/check_procs.t t/check_smtp.t t/check_snmp.t t/check_swap.t t/check_tcp.t t/check_time.t t/check_udp.t t/check_users.t t/negate.t POSUB = po POW_LIB = +PRAGMA_SYSTEM_HEADER = #pragma GCC system_header PST3CFLAGS = PTRDIFF_T_SUFFIX = PYTHON = /usr/bin/python RADIUSLIBS = RANLIB = ranlib RELEASE = 1 +RELEASE_PRESENT_FALSE = +RELEASE_PRESENT_TRUE = # +REPLACE_BTOWC = 0 REPLACE_CEILF = 0 REPLACE_CEILL = 0 REPLACE_CHOWN = 0 +REPLACE_CLOSE = 0 +REPLACE_DPRINTF = 0 REPLACE_FCHDIR = 0 +REPLACE_FCLOSE = 0 REPLACE_FFLUSH = 0 REPLACE_FLOORF = 0 REPLACE_FLOORL = 0 @@ -428,12 +583,28 @@ REPLACE_FTELLO = 0 REPLACE_GETCWD = 0 REPLACE_GETLINE = 0 REPLACE_GETPAGESIZE = 0 +REPLACE_HUGE_VAL = 0 REPLACE_ISFINITE = 0 +REPLACE_ISINF = 0 +REPLACE_ISNAN = 0 +REPLACE_ISWCNTRL = 0 REPLACE_LCHOWN = 0 REPLACE_LDEXPL = 0 +REPLACE_LOCALTIME_R = 0 REPLACE_LSEEK = 0 +REPLACE_MBRLEN = 0 +REPLACE_MBRTOWC = 0 +REPLACE_MBSINIT = 0 +REPLACE_MBSNRTOWCS = 0 +REPLACE_MBSRTOWCS = 0 +REPLACE_MBSTATE_T = 0 REPLACE_MEMMEM = 0 REPLACE_MKSTEMP = 0 +REPLACE_NAN = 0 +REPLACE_NANOSLEEP = GNULIB_PORTCHECK +REPLACE_OBSTACK_PRINTF = 0 +REPLACE_OPEN = 0 +REPLACE_PERROR = 0 REPLACE_PRINTF = 0 REPLACE_PUTENV = 0 REPLACE_ROUND = 0 @@ -443,19 +614,32 @@ REPLACE_SIGNBIT = 0 REPLACE_SIGNBIT_USING_GCC = 0 REPLACE_SNPRINTF = 0 REPLACE_SPRINTF = 0 +REPLACE_STDIO_WRITE_FUNCS = 0 REPLACE_STRCASESTR = 0 +REPLACE_STRDUP = 0 REPLACE_STRERROR = 0 +REPLACE_STRPTIME = GNULIB_PORTCHECK REPLACE_STRSIGNAL = 0 REPLACE_STRSTR = 0 +REPLACE_STRTOD = 0 +REPLACE_TIMEGM = 1 +REPLACE_TRUNCL = 0 REPLACE_VASPRINTF = 0 +REPLACE_VDPRINTF = 0 REPLACE_VFPRINTF = 0 REPLACE_VPRINTF = 0 REPLACE_VSNPRINTF = 0 REPLACE_VSPRINTF = 0 +REPLACE_WCRTOMB = 0 +REPLACE_WCSNRTOMBS = 0 +REPLACE_WCSRTOMBS = 0 +REPLACE_WCTOB = 0 REPLACE_WCWIDTH = 0 -REV_DATESTAMP = 2008.05.27.23.05 -REV_TIMESTAMP = 20080527230527 -SCRIPT_TEST = t/check_file_age.t t/check_rpc.t t/utils.t +REPLACE_WRITE = 0 +REV_DATESTAMP = 2009.06.17.13.02 +REV_TIMESTAMP = 20090617130212 +SCRIPT_TEST = t/check_file_age.t t/check_ifoperstatus.t t/check_ifstatus.t t/check_rpc.t t/utils.t +SERVENT_LIB = SET_MAKE = SH = /bin/sh SHELL = /bin/sh @@ -469,10 +653,15 @@ STDINT_H = stdint.h STRIP = strip SUPPORT = Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n SYS_SOCKET_H = +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = 0 +TIME_H_DEFINES_STRUCT_TIMESPEC = 1 +UNISTD_H_HAVE_WINSOCK2_H = 0 +USE_LIBTAP_LOCAL_FALSE = +USE_LIBTAP_LOCAL_TRUE = # USE_NLS = yes USE_PARSE_INI_FALSE = USE_PARSE_INI_TRUE = # -VERSION = 1.4.12 +VERSION = 1.4.13 VOID_UNSETENV = 0 WARRANTY = The nagios 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 WCHAR_H = @@ -506,8 +695,8 @@ datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} -gl_LIBOBJS = asnprintf.o basename.o c-strtod.o cloexec.o creat-safer.o dirname.o dup-safer.o exitfail.o fd-safer.o fsusage.o mountlist.o open-safer.o pipe-safer.o printf-args.o printf-parse.o regex.o safe-read.o safe-write.o stripslash.o vasnprintf.o xmalloc.o -gl_LTLIBOBJS = asnprintf.lo basename.lo c-strtod.lo cloexec.lo creat-safer.lo dirname.lo dup-safer.lo exitfail.lo fd-safer.lo fsusage.lo mountlist.lo open-safer.lo pipe-safer.lo printf-args.lo printf-parse.lo regex.lo safe-read.lo safe-write.lo stripslash.lo vasnprintf.lo xmalloc.lo +gl_LIBOBJS = asnprintf.o basename.o c-strtod.o cloexec.o creat-safer.o dirname.o dup-safer.o exitfail.o fd-safer.o fsusage.o mktime.o mountlist.o open-safer.o pipe-safer.o printf-args.o printf-parse.o regex.o safe-read.o safe-write.o stripslash.o timegm.o vasnprintf.o xmalloc.o +gl_LTLIBOBJS = asnprintf.lo basename.lo c-strtod.lo cloexec.lo creat-safer.lo dirname.lo dup-safer.lo exitfail.lo fd-safer.lo fsusage.lo mktime.lo mountlist.lo open-safer.lo pipe-safer.lo printf-args.lo printf-parse.lo regex.lo safe-read.lo safe-write.lo stripslash.lo timegm.lo vasnprintf.lo xmalloc.lo gltests_LIBOBJS = gltests_LTLIBOBJS = host = i686-pc-linux-gnu @@ -518,7 +707,7 @@ host_vendor = pc htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = /tmp/nagiosplug/build-aux/install-sh +install_sh = /tmp/tonvoon/tmp_snapshot/trunk/nagiosplug/build-aux/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale diff --git a/perlmods/Makefile.in b/perlmods/Makefile.in index a92c328..92fede0 100644 --- a/perlmods/Makefile.in +++ b/perlmods/Makefile.in @@ -38,17 +38,19 @@ subdir = perlmods DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ - $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ - $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \ - $(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \ - $(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \ + $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \ + $(top_srcdir)/gl/m4/dos.m4 \ $(top_srcdir)/gl/m4/double-slash-root.m4 \ - $(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \ + $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \ $(top_srcdir)/gl/m4/exitfail.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-safer.m4 \ - $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \ + $(top_srcdir)/gl/m4/floorf.m4 \ $(top_srcdir)/gl/m4/fstypename.m4 \ $(top_srcdir)/gl/m4/fsusage.m4 \ $(top_srcdir)/gl/m4/getaddrinfo.m4 \ @@ -58,7 +60,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/glibc21.m4 \ $(top_srcdir)/gl/m4/gnulib-common.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ - $(top_srcdir)/gl/m4/iconv.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/iconv.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \ $(top_srcdir)/gl/m4/intlmacosx.m4 \ @@ -67,17 +69,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \ $(top_srcdir)/gl/m4/lib-prefix.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/longlong.m4 \ $(top_srcdir)/gl/m4/ls-mntd-fs.m4 \ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \ $(top_srcdir)/gl/m4/mountlist.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/nls.m4 \ - $(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \ + $(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \ $(top_srcdir)/gl/m4/safe-read.m4 \ $(top_srcdir)/gl/m4/safe-write.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \ $(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \ @@ -87,13 +96,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \ $(top_srcdir)/gl/m4/strnlen.m4 \ $(top_srcdir)/gl/m4/sys_socket_h.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/unistd-safer.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/vasnprintf.m4 \ $(top_srcdir)/gl/m4/vasprintf.m4 \ $(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \ - $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \ - $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \ + $(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ + $(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -111,6 +123,7 @@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ @@ -141,16 +154,24 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +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@ F77 = @F77@ +FCNTL_H = @FCNTL_H@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ @@ -159,47 +180,85 @@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPL = @GNULIB_FREXPL@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -209,18 +268,37 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_ROUND = @GNULIB_ROUND@ GNULIB_ROUNDF = @GNULIB_ROUNDF@ GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ @@ -233,32 +311,57 @@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ 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_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ @@ -271,25 +374,46 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_OS_H = @HAVE_OS_H@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ @@ -303,8 +427,16 @@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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@ @@ -312,14 +444,20 @@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +HOSTENT_LIB = @HOSTENT_LIB@ HOSTNAME = @HOSTNAME@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -341,6 +479,10 @@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -353,15 +495,21 @@ MYSQLCFLAGS = @MYSQLCFLAGS@ MYSQLINCLUDE = @MYSQLINCLUDE@ MYSQLLIBS = @MYSQLLIBS@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_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@ @@ -403,16 +551,23 @@ PKG_ARCH = @PKG_ARCH@ PLUGIN_TEST = @PLUGIN_TEST@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PST3CFLAGS = @PST3CFLAGS@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ PYTHON = @PYTHON@ RADIUSLIBS = @RADIUSLIBS@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ +RELEASE_PRESENT_FALSE = @RELEASE_PRESENT_FALSE@ +RELEASE_PRESENT_TRUE = @RELEASE_PRESENT_TRUE@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -428,12 +583,28 @@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ +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_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -443,19 +614,32 @@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ 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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ REV_DATESTAMP = @REV_DATESTAMP@ REV_TIMESTAMP = @REV_TIMESTAMP@ SCRIPT_TEST = @SCRIPT_TEST@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ @@ -469,6 +653,11 @@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_LIBTAP_LOCAL_FALSE = @USE_LIBTAP_LOCAL_FALSE@ +USE_LIBTAP_LOCAL_TRUE = @USE_LIBTAP_LOCAL_TRUE@ USE_NLS = @USE_NLS@ USE_PARSE_INI_FALSE = @USE_PARSE_INI_FALSE@ USE_PARSE_INI_TRUE = @USE_PARSE_INI_TRUE@ diff --git a/perlmods/Nagios-Plugin-0.22.tar.gz b/perlmods/Nagios-Plugin-0.22.tar.gz deleted file mode 100644 index 4a97bb5..0000000 Binary files a/perlmods/Nagios-Plugin-0.22.tar.gz and /dev/null differ diff --git a/perlmods/Nagios-Plugin-0.27.tar.gz b/perlmods/Nagios-Plugin-0.27.tar.gz new file mode 100644 index 0000000..78c6ce9 Binary files /dev/null and b/perlmods/Nagios-Plugin-0.27.tar.gz differ diff --git a/pkg/solaris/pkginfo b/pkg/solaris/pkginfo index b615db6..f8f832a 100644 --- a/pkg/solaris/pkginfo +++ b/pkg/solaris/pkginfo @@ -2,11 +2,11 @@ PKG="NAGplugin" NAME="nagios-plugins" DESC="Nagios network monitoring plugins" ARCH="unknown" -VERSION="1.4.12,REV=2008.05.27.23.05" +VERSION="1.4.13,REV=2009.06.17.13.02" CATEGORY="application" VENDOR="Nagios Plugin Development Team" EMAIL="nagiosplug-devel@lists.sourceforge.net" -PSTAMP="nag20080527230527" +PSTAMP="nag20090617130212" BASEDIR="/" CLASSES="none" diff --git a/plugins-root/Makefile.am b/plugins-root/Makefile.am index bca3ceb..dcab4cc 100644 --- a/plugins-root/Makefile.am +++ b/plugins-root/Makefile.am @@ -1,5 +1,16 @@ ## Process this file with automake to produce Makefile.in +if RELEASE_PRESENT +NP_VERSION = $(PACKAGE_VERSION) +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) INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@ @@ -71,7 +82,10 @@ check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS) # -m64 needed at compiler and linker phase pst3_CFLAGS = @PST3CFLAGS@ pst3_LDFLAGS = @PST3CFLAGS@ -pst3_LDADD = -lkvm 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 index 53bbaac..0db53c7 100644 --- a/plugins-root/Makefile.in +++ b/plugins-root/Makefile.in @@ -41,17 +41,19 @@ subdir = plugins-root DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ - $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ - $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \ - $(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \ - $(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \ + $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \ + $(top_srcdir)/gl/m4/dos.m4 \ $(top_srcdir)/gl/m4/double-slash-root.m4 \ - $(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \ + $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \ $(top_srcdir)/gl/m4/exitfail.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-safer.m4 \ - $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \ + $(top_srcdir)/gl/m4/floorf.m4 \ $(top_srcdir)/gl/m4/fstypename.m4 \ $(top_srcdir)/gl/m4/fsusage.m4 \ $(top_srcdir)/gl/m4/getaddrinfo.m4 \ @@ -61,7 +63,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/glibc21.m4 \ $(top_srcdir)/gl/m4/gnulib-common.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ - $(top_srcdir)/gl/m4/iconv.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/iconv.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \ $(top_srcdir)/gl/m4/intlmacosx.m4 \ @@ -70,17 +72,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \ $(top_srcdir)/gl/m4/lib-prefix.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/longlong.m4 \ $(top_srcdir)/gl/m4/ls-mntd-fs.m4 \ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \ $(top_srcdir)/gl/m4/mountlist.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/nls.m4 \ - $(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \ + $(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \ $(top_srcdir)/gl/m4/safe-read.m4 \ $(top_srcdir)/gl/m4/safe-write.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \ $(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \ @@ -90,13 +99,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \ $(top_srcdir)/gl/m4/strnlen.m4 \ $(top_srcdir)/gl/m4/sys_socket_h.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/unistd-safer.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/vasnprintf.m4 \ $(top_srcdir)/gl/m4/vasprintf.m4 \ $(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \ - $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \ - $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \ + $(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ + $(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -117,7 +129,7 @@ check_icmp_SOURCES = check_icmp.c check_icmp_OBJECTS = check_icmp.$(OBJEXT) pst3_SOURCES = pst3.c pst3_OBJECTS = pst3-pst3.$(OBJEXT) -pst3_DEPENDENCIES = +pst3_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles @@ -142,6 +154,7 @@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ @@ -172,16 +185,24 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +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@ F77 = @F77@ +FCNTL_H = @FCNTL_H@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ @@ -190,47 +211,85 @@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPL = @GNULIB_FREXPL@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -240,18 +299,37 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_ROUND = @GNULIB_ROUND@ GNULIB_ROUNDF = @GNULIB_ROUNDF@ GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ @@ -264,32 +342,57 @@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ 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_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ @@ -302,25 +405,46 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_OS_H = @HAVE_OS_H@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ @@ -334,8 +458,16 @@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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@ @@ -343,14 +475,20 @@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +HOSTENT_LIB = @HOSTENT_LIB@ HOSTNAME = @HOSTNAME@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -372,6 +510,10 @@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -384,15 +526,21 @@ MYSQLCFLAGS = @MYSQLCFLAGS@ MYSQLINCLUDE = @MYSQLINCLUDE@ MYSQLLIBS = @MYSQLLIBS@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_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@ @@ -434,16 +582,23 @@ PKG_ARCH = @PKG_ARCH@ PLUGIN_TEST = @PLUGIN_TEST@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PST3CFLAGS = @PST3CFLAGS@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ PYTHON = @PYTHON@ RADIUSLIBS = @RADIUSLIBS@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ +RELEASE_PRESENT_FALSE = @RELEASE_PRESENT_FALSE@ +RELEASE_PRESENT_TRUE = @RELEASE_PRESENT_TRUE@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -459,12 +614,28 @@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ +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_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -474,19 +645,32 @@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ 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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ REV_DATESTAMP = @REV_DATESTAMP@ REV_TIMESTAMP = @REV_TIMESTAMP@ SCRIPT_TEST = @SCRIPT_TEST@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ @@ -500,6 +684,11 @@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_LIBTAP_LOCAL_FALSE = @USE_LIBTAP_LOCAL_FALSE@ +USE_LIBTAP_LOCAL_TRUE = @USE_LIBTAP_LOCAL_TRUE@ USE_NLS = @USE_NLS@ USE_PARSE_INI_FALSE = @USE_PARSE_INI_FALSE@ USE_PARSE_INI_TRUE = @USE_PARSE_INI_TRUE@ @@ -567,6 +756,8 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ with_trusted_path = @with_trusted_path@ +@RELEASE_PRESENT_TRUE@NP_VERSION = $(PACKAGE_VERSION) +AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"' INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@ EXTRA_DIST = pst3.c BASEOBJS = ../plugins/utils.o ../lib/libnagiosplug.a ../gl/libgnu.a @@ -598,7 +789,6 @@ check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS) # -m64 needed at compiler and linker phase pst3_CFLAGS = @PST3CFLAGS@ pst3_LDFLAGS = @PST3CFLAGS@ -pst3_LDADD = -lkvm check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS) check_icmp_DEPENDENCIES = check_icmp.c $(NETOBJS) all: all-am @@ -885,7 +1075,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ +clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am @@ -935,8 +1125,8 @@ ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-generic clean-libtool clean-noinstPROGRAMS ctags \ - distclean distclean-compile distclean-generic \ + clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ + ctags 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-exec install-exec-am \ @@ -947,6 +1137,10 @@ uninstall-am: uninstall-info-am pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am +@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 @@ -969,6 +1163,9 @@ install-exec-local: $(noinst_PROGRAMS) 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 index fde2796..bdd348f 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c @@ -6,8 +6,6 @@ * Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org) * Copyright (c) 2001-2007 Nagios Plugin Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_dhcp plugin @@ -32,12 +30,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_dhcp.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ const char *progname = "check_dhcp"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "2001-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -79,8 +75,8 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; #elif defined(__sun__) || defined(__solaris__) || defined(__hpux__) -#define INSAP 22 -#define OUTSAP 24 +#define INSAP 22 +#define OUTSAP 24 #include #include @@ -90,17 +86,17 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; #define bcopy(source, destination, length) memcpy(destination, source, length) -#define AREA_SZ 5000 /* buffer length in bytes */ +#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 +#define GOT_CTRL 1 +#define GOT_DATA 2 +#define GOT_BOTH 3 +#define GOT_INTR 4 +#define GOT_ERR 128 #define u_int8_t uint8_t #define u_int16_t uint16_t @@ -195,7 +191,6 @@ typedef struct requested_server_struct{ #define DHCP_INFINITE_TIME 0xFFFFFFFF #define DHCP_BROADCAST_FLAG 32768 -#define DHCP_UNICAST_FLAG 0 #define DHCP_SERVER_PORT 67 #define DHCP_CLIENT_PORT 68 @@ -223,7 +218,7 @@ 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_servers=0; int requested_responses=0; int request_specific_address=FALSE; @@ -383,7 +378,7 @@ int get_hardware_address(int sock,char *interface_name){ unit = atoi(p) ; *p = '\0' ; 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); @@ -536,7 +531,7 @@ int send_dhcp_discover(int sock){ /* send the DHCPDISCOVER packet out */ send_dhcp_packet(&discover_packet,sizeof(discover_packet),sock,&sockaddr_broadcast); - if(verbose) + if(verbose) printf("\n\n"); return OK; @@ -565,7 +560,7 @@ int get_dhcp_offer(int sock){ if((current_time-start_time)>=dhcpoffer_timeout) break; - if(verbose) + if(verbose) printf("\n\n"); bzero(&source,sizeof(source)); @@ -582,7 +577,7 @@ int get_dhcp_offer(int sock){ continue; } else{ - if(verbose) + if(verbose) printf(_("Result=OK\n")); responses++; @@ -627,7 +622,7 @@ int get_dhcp_offer(int sock){ printf("\n"); if(result==ERROR){ - if(verbose) + if(verbose) printf(_("DHCPOFFER hardware address did not match our own - ignoring packet\n")); continue; @@ -661,7 +656,7 @@ int send_dhcp_packet(void *buffer, int buffer_size, int sock, struct sockaddr_in result=sendto(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)dest,sizeof(*dest)); - if(verbose) + if(verbose) printf(_("send_dhcp_packet result: %d\n"),result); if(result<0) @@ -767,7 +762,7 @@ int create_dhcp_socket(void){ } /* set the broadcast option - we need this to listen to DHCP broadcast messages */ - if(setsockopt(sock,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof flag)<0){ + 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); } @@ -854,7 +849,7 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){ /* get option length */ option_length=offer_packet->options[x++]; - if(verbose) + if(verbose) printf("Option: %d (0x%02X)\n",option_type,option_length); /* get option data */ @@ -990,7 +985,7 @@ int get_results(void){ 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) + if(temp_server->answered) printf(_(" (duplicate)")); printf(_("\n")); } @@ -1091,7 +1086,7 @@ int call_getopt(int argc, char **argv){ int option_index = 0; static struct option long_options[] = - { + { {"serverip", required_argument,0,'s'}, {"requestedip", required_argument,0,'r'}, {"timeout", required_argument,0,'t'}, @@ -1169,7 +1164,7 @@ int call_getopt(int argc, char **argv){ break; case 'V': /* version */ - print_revision(progname,revision); + print_revision(progname, NP_VERSION); exit(STATE_OK); case 'h': /* help */ @@ -1307,7 +1302,7 @@ static int dl_bind(int fd, int sap, u_char *addr){ /*********************************************************************** * interface: - * function mac_addr_dlpi - get the mac address of the interface with + * 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 @@ -1386,7 +1381,7 @@ void print_hardware_address(const unsigned char *address){ /* print usage help */ void print_help(void){ - print_revision(progname,revision); + print_revision(progname, NP_VERSION); printf("Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)\n"); printf (COPYRIGHT, copyright, email); diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index f1ccd1e..cba7c44 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -6,8 +6,6 @@ * Copyright (c) 2005-2008 Nagios Plugins Development Team * Original Author : Andreas Ericsson * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_icmp plugin @@ -35,14 +33,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_icmp.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ /* progname may change */ /* char *progname = "check_icmp"; */ char *progname; -const char *revision = "$Revision: 1991 $"; const char *copyright = "2005-2008"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -74,6 +70,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include #include #include +#include /** sometimes undefined system macros (quite a few, actually) **/ @@ -106,6 +103,9 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; # define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 #endif +#ifndef DBL_MAX +# define DBL_MAX 9.9999999999e999 +#endif typedef unsigned short range_t; /* type for get_range() -- unimplemented */ @@ -120,6 +120,8 @@ typedef struct rta_host { unsigned char icmp_type, icmp_code; /* type and code from errors */ unsigned short flags; /* control/status flags */ double rta; /* measured RTA */ + double rtmax; /* max rtt */ + double rtmin; /* min rtt */ unsigned char pl; /* measured packet loss */ struct rta_host *next; /* linked list */ } rta_host; @@ -182,14 +184,14 @@ 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, char *, unsigned int, struct sockaddr *, u_int *); +static int recvfrom_wto(int, void *, unsigned int, struct sockaddr *, u_int *); static int send_icmp_ping(int, struct rta_host *); static int get_threshold(char *str, threshold *th); static void run_checks(void); static void set_source_ip(char *); static int add_target(char *); static int add_target_ip(char *, struct in_addr *); -static int handle_random_icmp(char *, struct sockaddr_in *); +static int handle_random_icmp(unsigned char *, struct sockaddr_in *); static unsigned short icmp_checksum(unsigned short *, int); static void finish(int); static void crash(const char *, ...); @@ -203,7 +205,9 @@ extern char **environ; static struct rta_host **table, *cursor, *list; static threshold crit = {80, 500000}, warn = {40, 200000}; static int mode, protocols, sockets, debug = 0, timeout = 10; -static unsigned short icmp_pkt_size, icmp_data_size = DEFAULT_PING_DATA_SIZE; +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; #define icmp_pkts_en_route (icmp_sent - (icmp_recv + icmp_lost)) static unsigned short targets_down = 0, targets = 0, packets = 0; @@ -296,7 +300,7 @@ get_icmp_error_msg(unsigned char icmp_type, unsigned char icmp_code) } static int -handle_random_icmp(char *packet, struct sockaddr_in *addr) +handle_random_icmp(unsigned char *packet, struct sockaddr_in *addr) { struct icmp p, sent_icmp; struct rta_host *host = NULL; @@ -453,12 +457,22 @@ main(int argc, char **argv) /* parse the arguments */ for(i = 1; i < argc; i++) { while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) { + long size; switch(arg) { case 'v': debug++; break; case 'b': - /* silently ignored for now */ + 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: %d and %d", + sizeof(struct icmp) + sizeof(struct icmp_ping_data), + MAX_PING_DATA - 1); + break; case 'i': pkt_interval = get_timevar(optarg); @@ -499,7 +513,7 @@ main(int argc, char **argv) set_source_ip(optarg); break; case 'V': /* version */ - /*print_revision (progname, revision);*/ /* FIXME: Why? */ + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'h': /* help */ print_help (); @@ -587,13 +601,6 @@ main(int argc, char **argv) } } - icmp_pkt_size = icmp_data_size + ICMP_MINLEN; - if(debug > 2) printf("icmp_pkt_size = %u\n", icmp_pkt_size); - if(icmp_pkt_size < sizeof(struct icmp) + sizeof(struct icmp_ping_data)) { - icmp_pkt_size = sizeof(struct icmp) + sizeof(struct icmp_ping_data); - } - if(debug > 2) printf("icmp_pkt_size = %u\n", icmp_pkt_size); - if(debug) { printf("crit = {%u, %u%%}, warn = {%u, %u%%}\n", crit.rta, crit.pl, warn.rta, warn.pl); @@ -687,7 +694,7 @@ static int wait_for_reply(int sock, u_int t) { int n, hlen; - static char buf[4096]; + static unsigned char buf[4096]; struct sockaddr_in resp_addr; struct ip *ip; struct icmp icp; @@ -777,11 +784,15 @@ wait_for_reply(int sock, u_int t) host->time_waited += tdiff; host->icmp_recv++; icmp_recv++; + if (tdiff > host->rtmax) + host->rtmax = tdiff; + if (tdiff < host->rtmin) + host->rtmin = tdiff; if(debug) { - printf("%0.3f ms rtt from %s, outgoing ttl: %u, incoming ttl: %u\n", + printf("%0.3f ms rtt from %s, outgoing ttl: %u, incoming ttl: %u, max: %0.3f, min: %0.3f\n", (float)tdiff / 1000, inet_ntoa(resp_addr.sin_addr), - ttl, ip->ip_ttl); + ttl, ip->ip_ttl, (float)host->rtmax / 1000, (float)host->rtmin / 1000); } /* if we're in hostcheck mode, exit with limited printouts */ @@ -803,7 +814,7 @@ static int send_icmp_ping(int sock, struct rta_host *host) { static union { - char *buf; /* re-use so we prevent leaks */ + void *buf; /* re-use so we prevent leaks */ struct icmp *icp; u_short *cksum_in; } packet = { NULL }; @@ -856,7 +867,7 @@ send_icmp_ping(int sock, struct rta_host *host) } static int -recvfrom_wto(int sock, char *buf, unsigned int len, struct sockaddr *saddr, +recvfrom_wto(int sock, void *buf, unsigned int len, struct sockaddr *saddr, u_int *timo) { u_int slen; @@ -988,11 +999,12 @@ finish(int sig) host = list; while(host) { if(debug) puts(""); - printf("%srta=%0.3fms;%0.3f;%0.3f;0; %spl=%u%%;%u;%u;; ", + printf("%srta=%0.3fms;%0.3f;%0.3f;0; %spl=%u%%;%u;%u;; %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 : "", - host->pl, warn.pl, crit.pl); + (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl, + (targets > 1) ? host->name : "", (float)host->rtmax / 1000, + (targets > 1) ? host->name : "", (host->rtmin < DBL_MAX) ? (float)host->rtmin / 1000 : (float)0); host = host->next; } @@ -1023,7 +1035,7 @@ get_timevaldiff(struct timeval *early, struct timeval *later) if(!early) early = &prog_start; /* if early > later we return 0 so as to indicate a timeout */ - if(early->tv_sec > early->tv_sec || + if(early->tv_sec > later->tv_sec || (early->tv_sec == later->tv_sec && early->tv_usec > later->tv_usec)) { return 0; @@ -1069,6 +1081,8 @@ add_target_ip(char *arg, struct in_addr *in) host->saddr_in.sin_family = AF_INET; host->saddr_in.sin_addr.s_addr = in->s_addr; + host->rtmin = DBL_MAX; + if(!list) list = cursor = host; else cursor->next = host; @@ -1255,7 +1269,7 @@ void print_help(void) { - /*print_revision (progname, revision);*/ /* FIXME: Why? */ + /*print_revision (progname);*/ /* FIXME: Why? */ printf ("Copyright (c) 2005 Andreas Ericsson \n"); printf (COPYRIGHT, copyright, email); @@ -1271,10 +1285,10 @@ print_help(void) printf (" %s\n", _("specify a target")); printf (" %s\n", "-w"); printf (" %s", _("warning threshold (currently ")); - printf ("%0.3fms,%u%%)\n", (float)warn.rta / 1000 , warn.pl / 1000); + 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, crit.pl); + printf ("%0.3fms,%u%%)\n", (float)crit.rta / 1000, crit.pl); printf (" %s\n", "-s"); printf (" %s\n", _("specify a source IP address or device name")); printf (" %s\n", "-n"); @@ -1291,12 +1305,13 @@ print_help(void) printf ("\n"); printf (" %s\n", "-l"); printf (" %s", _("TTL on outgoing packets (currently ")); - printf ("%u)", ttl); + 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", _("icmp packet size (currenly ignored)")); + 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")); diff --git a/plugins-root/pst3.c b/plugins-root/pst3.c index 5b0e9d7..8513656 100644 --- a/plugins-root/pst3.c +++ b/plugins-root/pst3.c @@ -1,253 +1,257 @@ -/* pst3.c +/***************************************************************************** +* +* pst3 +* +* License: GPL +* Copyright (c) 2008 Nagios Plugin 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 * -* Third version to get process arg info; this time by using -* a combination of reading the /proc//psinfo structures -* and reading the complete arg vector from kernel memory structures. +* 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 * -* Developed and tested under Solaris 5.8 (both 32 and 64 bit modes). -* -* NOTE: This program must be setuid-root (or run by root) to work! -* -* Written: 2005-04-28 R.W.Ingraham -*/ +* 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 . +* +*****************************************************************************/ - -#define _KMEMUSER 1 - -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include #include #include - +#include +#include +#include +#include /* - * Constants + * Constants */ -#define PROC_DIR "/proc" -#define MAX_PATH 1024 - +#define PROC_DIR "/proc" +#define ARGS 30 /* - * Structures - */ - - -/* - * Globals + * Globals */ static char * szProg; -static kvm_t * kd; -static struct proc * pProc; -static struct user * pUser; -static char ** myArgv; - /* - * Prototypes + * Prototypes */ - -static int HandleFile (struct dirent *pDent); -static int HandlePsInfo (char *szPath, psinfo_t *pPsInfo); -static int GetArgVectors (pid_t pid); -static void ShowArgVectors (void); -static void ReleaseArgVectors(); - +void usage(); /*----------------------------------------------------------------------------*/ int main (int argc, char **argv) { - DIR *pDir; - struct dirent *pDent; - int retcode = 0; + 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]; - /* 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); - } + /* 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); + } - /* Get a handle to the running kernel image */ - if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, argv[0])) == NULL) - { - fprintf(stderr, "%s: Failed to open kernel memory: %s\n", szProg, strerror(errno)); - exit(2); - } + if ((procdir = opendir(PROC_DIR)) == NULL) { + fprintf(stderr, "%s: cannot open PROC directory %s\n", szProg, PROC_DIR); + exit(1); + } - /* Open the /proc directory */ - if ((pDir = opendir(PROC_DIR)) != NULL) - { - /* Display column headings */ - printf("S UID PID PPID VSZ RSS %%CPU COMMAND ARGS\n"); + /* 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 ((pDent = readdir(pDir)) != NULL) - { - /* Handle each pid sub-directory */ - HandleFile(pDent); - } + /* 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; - /* Close the directory */ - closedir(pDir); - } - else /* ERROR: Failure to open PROC_DIR */ - { - fprintf(stderr, "%s: Failed to open \"%s\": %s\n", szProg, PROC_DIR, strerror(errno)); - retcode = 3; - } + if(proc->d_name[0] == '.') + continue; - /* Close the handle to the running kernel image */ - kvm_close(kd); + 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; - return retcode; + if((as_fd = open(as_name, O_RDONLY)) == -1) + 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;id_name[0] == '.') - return 0; - - /* Cosntruct the path to the psinfo file */ - len = sprintf(szPath, "%s/%s/psinfo", PROC_DIR, pDent->d_name); - - /* Open the psinfo file for this pid and print out its arg vectors */ - if ((fd = open(szPath, O_RDONLY)) >= 0) - { - /* Read the psinfo struct */ - if ((len = read(fd, &sPsInfo, sizeof(sPsInfo))) != sizeof(sPsInfo)) - { - rc = errno; - fprintf(stderr, "%s: Read error of psinfo structure (%d)\n", szPath, len); - return rc; - } - - /* Close the psinfo file */ - close(fd); - - /* Pass psinfo struct to reporting function */ - HandlePsInfo(szPath, &sPsInfo); - } - else if (errno != ENOENT) - { - rc = errno; - fprintf(stderr, "%s: %s\n", szPath, strerror(errno)); - } - - 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 arguements\n"); + return; } - -/*----------------------------------------------------------------------------*/ - -static int HandlePsInfo (char *szPath, psinfo_t *pPsInfo) -{ - int retcode; - char *thisProg; - - /* Make sure that the process is still there */ - if ((retcode = GetArgVectors(pPsInfo->pr_pid)) == 0) - { - /* We use the program name from the kvm argv[0] instead - * of pr_fname from the psinfo struct because pr_fname - * may be truncated. - * - * Also, strip-off leading path information. - */ - if ((thisProg = strrchr(myArgv[0], '/')) != NULL) - thisProg++; - else - thisProg = myArgv[0]; - - /* Display the ps columns (except for argv) */ - printf("%c %5d %5d %5d %6lu %6lu %4.1f %s ", - pPsInfo->pr_lwp.pr_sname, - (int)(pPsInfo->pr_euid), - (int)(pPsInfo->pr_pid), - (int)(pPsInfo->pr_ppid), - (unsigned long)(pPsInfo->pr_size), - (unsigned long)(pPsInfo->pr_rssize), - ((float)(pPsInfo->pr_pctcpu) / 0x8000 * 100.0), - thisProg); - - /* Display the arg vectors associated with this pid */ - ShowArgVectors(); - - /* Release the arg vector buffer memory */ - ReleaseArgVectors(); - } - - return retcode; -} - -/*----------------------------------------------------------------------------*/ - -static int GetArgVectors (pid_t pid) -{ - int retcode = 1; - - /* Get the proc structure for the specified PID */ - if ((pProc = kvm_getproc(kd, pid)) != NULL) - { - /* Save a copy of the process' u-area */ - if ((pUser = kvm_getu(kd, pProc)) != NULL) - { - /* Reconstruct the process' argv vector array */ - if (kvm_getcmd(kd, pProc, pUser, &myArgv, NULL) == 0) - { - retcode = 0; - } - } - } - - return retcode; -} - -/*----------------------------------------------------------------------------*/ - -static void ShowArgVectors (void) -{ - int i; - - for (i=0; myArgv[i]; i++) - { - printf(" %s", myArgv[i]); - } - printf("\n"); -} - -/*----------------------------------------------------------------------------*/ - -static void ReleaseArgVectors() -{ - /* NOOP */ -} - -/*----------------------------------------------------------------------------*/ diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am index 01fca20..d1ea3c4 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -1,5 +1,14 @@ ## Process this file with automake to produce Makefile.in +if RELEASE_PRESENT +NP_VERSION = $(PACKAGE_VERSION) +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 @@ -29,9 +38,13 @@ test-debug: CLEANFILES=$(libexec_SCRIPTS) .pl : - $(AWK) -f ./subst $< > $@ + NP_VERSION=$(NP_VERSION) $(AWK) -f ./subst $< > $@ chmod +x $@ .sh : - $(AWK) -f ./subst $< > $@ + NP_VERSION=$(NP_VERSION) $(AWK) -f ./subst $< > $@ chmod +x $@ + +clean-local: + rm -f NP-VERSION-FILE + diff --git a/plugins-scripts/Makefile.in b/plugins-scripts/Makefile.in index 8761bc1..5dcd18d 100644 --- a/plugins-scripts/Makefile.in +++ b/plugins-scripts/Makefile.in @@ -39,17 +39,19 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/subst.in $(srcdir)/utils.pm.in $(srcdir)/utils.sh.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ - $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ - $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \ - $(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \ - $(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \ + $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \ + $(top_srcdir)/gl/m4/dos.m4 \ $(top_srcdir)/gl/m4/double-slash-root.m4 \ - $(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \ + $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \ $(top_srcdir)/gl/m4/exitfail.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-safer.m4 \ - $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \ + $(top_srcdir)/gl/m4/floorf.m4 \ $(top_srcdir)/gl/m4/fstypename.m4 \ $(top_srcdir)/gl/m4/fsusage.m4 \ $(top_srcdir)/gl/m4/getaddrinfo.m4 \ @@ -59,7 +61,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/glibc21.m4 \ $(top_srcdir)/gl/m4/gnulib-common.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ - $(top_srcdir)/gl/m4/iconv.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/iconv.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \ $(top_srcdir)/gl/m4/intlmacosx.m4 \ @@ -68,17 +70,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \ $(top_srcdir)/gl/m4/lib-prefix.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/longlong.m4 \ $(top_srcdir)/gl/m4/ls-mntd-fs.m4 \ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \ $(top_srcdir)/gl/m4/mountlist.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/nls.m4 \ - $(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \ + $(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \ $(top_srcdir)/gl/m4/safe-read.m4 \ $(top_srcdir)/gl/m4/safe-write.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \ $(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \ @@ -88,13 +97,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \ $(top_srcdir)/gl/m4/strnlen.m4 \ $(top_srcdir)/gl/m4/sys_socket_h.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/unistd-safer.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/vasnprintf.m4 \ $(top_srcdir)/gl/m4/vasprintf.m4 \ $(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \ - $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \ - $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \ + $(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ + $(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -116,6 +128,7 @@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ @@ -146,16 +159,24 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +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@ F77 = @F77@ +FCNTL_H = @FCNTL_H@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ @@ -164,47 +185,85 @@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPL = @GNULIB_FREXPL@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -214,18 +273,37 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_ROUND = @GNULIB_ROUND@ GNULIB_ROUNDF = @GNULIB_ROUNDF@ GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ @@ -238,32 +316,57 @@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ 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_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ @@ -276,25 +379,46 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_OS_H = @HAVE_OS_H@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ @@ -308,8 +432,16 @@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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@ @@ -317,14 +449,20 @@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +HOSTENT_LIB = @HOSTENT_LIB@ HOSTNAME = @HOSTNAME@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -346,6 +484,10 @@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -358,15 +500,21 @@ MYSQLCFLAGS = @MYSQLCFLAGS@ MYSQLINCLUDE = @MYSQLINCLUDE@ MYSQLLIBS = @MYSQLLIBS@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_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@ @@ -408,16 +556,23 @@ PKG_ARCH = @PKG_ARCH@ PLUGIN_TEST = @PLUGIN_TEST@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PST3CFLAGS = @PST3CFLAGS@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ PYTHON = @PYTHON@ RADIUSLIBS = @RADIUSLIBS@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ +RELEASE_PRESENT_FALSE = @RELEASE_PRESENT_FALSE@ +RELEASE_PRESENT_TRUE = @RELEASE_PRESENT_TRUE@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -433,12 +588,28 @@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ +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_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -448,19 +619,32 @@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ 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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ REV_DATESTAMP = @REV_DATESTAMP@ REV_TIMESTAMP = @REV_TIMESTAMP@ SCRIPT_TEST = @SCRIPT_TEST@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ @@ -474,6 +658,11 @@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_LIBTAP_LOCAL_FALSE = @USE_LIBTAP_LOCAL_FALSE@ +USE_LIBTAP_LOCAL_TRUE = @USE_LIBTAP_LOCAL_TRUE@ USE_NLS = @USE_NLS@ USE_PARSE_INI_FALSE = @USE_PARSE_INI_FALSE@ USE_PARSE_INI_TRUE = @USE_PARSE_INI_TRUE@ @@ -541,6 +730,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ with_trusted_path = @with_trusted_path@ +@RELEASE_PRESENT_TRUE@NP_VERSION = $(PACKAGE_VERSION) SUFFIXES = .pl .sh libexec_SCRIPTS = check_breeze check_disk_smb check_flexlm check_ircd \ check_log check_oracle check_rpc check_sensors check_wave \ @@ -765,7 +955,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -810,9 +1000,9 @@ ps-am: uninstall-am: uninstall-info-am uninstall-libexecSCRIPTS .PHONY: all all-am check check-TESTS check-am clean clean-generic \ - clean-libtool distclean distclean-generic distclean-libtool \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-exec \ + clean-libtool clean-local distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libexecSCRIPTS install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ @@ -820,6 +1010,10 @@ uninstall-am: uninstall-info-am uninstall-libexecSCRIPTS mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am uninstall-libexecSCRIPTS +@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 @@ -830,12 +1024,15 @@ test-debug: 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 : - $(AWK) -f ./subst $< > $@ + NP_VERSION=$(NP_VERSION) $(AWK) -f ./subst $< > $@ chmod +x $@ .sh : - $(AWK) -f ./subst $< > $@ + NP_VERSION=$(NP_VERSION) $(AWK) -f ./subst $< > $@ 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 index cb35976..a4e8542 100755 --- a/plugins-scripts/check_breeze.pl +++ b/plugins-scripts/check_breeze.pl @@ -26,7 +26,7 @@ GetOptions "C=s" => \$opt_C, "community=s" => \$opt_C); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 820 $'); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -65,7 +65,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 820 $'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Jeffrey Blank/Karl DeBisschop This plugin reports the signal strength of a Breezecom wireless equipment diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 60d634b..3f531ac 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl @@ -16,7 +16,6 @@ # drives is a pain in the butt # 2-May-2002 - SGhosh fix for embedded perl # -# $Id: check_disk_smb.pl 1247 2005-10-13 10:14:33Z seanius $ # require 5.004; @@ -52,7 +51,7 @@ GetOptions "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 1247 $'); #' + print_revision($PROGNAME,'@NP_VERSION@'); #' exit $ERRORS{'OK'}; } @@ -243,7 +242,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1247 $'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop Perl Check SMB Disk plugin for Nagios diff --git a/plugins-scripts/check_file_age.pl b/plugins-scripts/check_file_age.pl index 2dd6461..dcd5efa 100755 --- a/plugins-scripts/check_file_age.pl +++ b/plugins-scripts/check_file_age.pl @@ -1,5 +1,4 @@ #!/bin/perl -w -# $Id: check_file_age.pl 1750 2007-07-07 11:54:29Z psychotrahe $ # check_file_age.pl Copyright (C) 2003 Steven Grimm # @@ -55,7 +54,7 @@ GetOptions( "C=f" => \$opt_C, "critical-size=f" => \$opt_C); if ($opt_V) { - print_revision($PROGNAME, '$Revision: 1750 $'); + print_revision($PROGNAME, '@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -102,7 +101,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME, '$Revision: 1750 $'); + print_revision($PROGNAME, '@NP_VERSION@'); print "Copyright (c) 2003 Steven Grimm\n\n"; print_usage(); print "\n"; diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl index 0c90ab9..54d933c 100755 --- a/plugins-scripts/check_flexlm.pl +++ b/plugins-scripts/check_flexlm.pl @@ -26,7 +26,6 @@ # initial version: 9-10-99 Ernst-Dieter Martin edmt@infineon.com # # License: GPL -# $Id: check_flexlm.pl 287 2003-02-04 06:16:16Z sghosh $ # # lmstat output patches from Steve Rigler/Cliff Rice 13-Apr-2002 # srigler@marathonoil.com,cerice@marathonoil.com @@ -57,7 +56,7 @@ GetOptions "t=i" => \$opt_t, "timeout=i" => \$opt_t); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 287 $'); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -217,7 +216,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 287 $'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Ernst-Dieter Martin/Karl DeBisschop Check available flexlm license managers diff --git a/plugins-scripts/check_ifoperstatus.pl b/plugins-scripts/check_ifoperstatus.pl old mode 100644 new mode 100755 index cd48a7a..588993b --- a/plugins-scripts/check_ifoperstatus.pl +++ b/plugins-scripts/check_ifoperstatus.pl @@ -25,7 +25,6 @@ # Report bugs to: nagiosplug-help@lists.sourceforge.net # # 11.01.2000 Version 1.0 -# $Id: check_ifoperstatus.pl 1642 2007-03-16 12:11:46Z gonzai $ # # Patches from Guy Van Den Bergh to warn on ifadminstatus down interfaces # instead of critical. @@ -44,29 +43,31 @@ use Getopt::Long; my $PROGNAME = "check_ifoperstatus"; sub print_help (); -sub usage (); +sub usage ($); +sub print_usage (); sub process_arguments (); 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) + '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, $auth, $priv, $context); +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'; @@ -83,11 +84,13 @@ 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 @@ -96,24 +99,36 @@ $status = process_arguments(); # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { - print ("ERROR: No snmp response from $hostname (alarm)\n"); - exit $ERRORS{"UNKNOWN"}; + 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) { +if (defined $ifdescr || defined $iftype) { # escape "/" in ifdescr - very common in the Cisco world - $ifdescr =~ s/\//\\\//g; - - $status=fetch_ifdescr(); # if using on device with large number of interfaces - # recommend use of SNMP v2 (get-bulk) + if (defined $iftype) { + $status=fetch_ifindex($snmpIfType, $iftype); + } else { + $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 retrive ifdescr snmpkey - $status-$snmpkey\n"; + printf "$state: could not retrive ifdescr/iftype snmpkey - $status-$snmpkey\n"; $session->close; exit $ERRORS{$state}; } @@ -134,99 +149,100 @@ 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}; - } +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}} - ); +$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 $name && not ($response->{$snmpIfName} eq $name) ) { - $state = 'UNKNOWN'; - $answer = "Interface name ($name) doesn't match snmp value ($response->{$snmpIfName}) (index $snmpkey)"; - print ("$state: $answer"); - exit $ERRORS{$state}; - } +## 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 consious 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."; +## define the interface name +if (defined $ifXTable) { + $name = $response->{$snmpIfName} ." - " .$response->{$snmpIfAlias} ; +}else{ + $name = $response->{$snmpIfDescr} ; +} - } 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."; - } +## if AdminStatus is down - some one made a consious 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"); +print ("$state: $answer\n"); exit $ERRORS{$state}; ### subroutines -sub fetch_ifdescr { - if (!defined ($response = $session->get_table($snmpIfDescr))) { +sub fetch_ifindex { + my $oid = shift; + my $lookup = shift; + + if (!defined ($response = $session->get_table($oid))) { $answer=$session->error; $session->close; $state = 'CRITICAL'; @@ -236,10 +252,10 @@ sub fetch_ifdescr { } foreach $key ( keys %{$response}) { - if ($response->{$key} =~ /^$ifdescr$/) { + if ($response->{$key} =~ /^$lookup$/) { $key =~ /.*\.(\d+)$/; $snmpkey = $1; - #print "$ifdescr = $key / $snmpkey \n"; #debug + #print "$lookup = $key / $snmpkey \n"; #debug } } unless (defined $snmpkey) { @@ -252,22 +268,28 @@ sub fetch_ifdescr { return $snmpkey; } -sub usage() { - printf "\nMissing arguments!\n"; - printf "\n"; - printf "usage: \n"; - printf "check_ifoperstatus -k -H [-C ]\n"; - printf "Copyright (C) 2000 Christoph Kron\n"; - printf "check_ifoperstatus.pl comes with ABSOLUTELY NO WARRANTY\n"; - printf "This programm is licensed under the terms of the "; - printf "GNU General Public License\n(check source code for details)\n"; - printf "\n\n"; - exit $ERRORS{"UNKNOWN"}; +sub usage($) { + print "$_[0]\n"; + print_usage(); + exit $ERRORS{"UNKNOWN"}; +} + +sub print_usage() { + printf "\n"; + printf "usage: \n"; + printf "check_ifoperstatus -k -H [-C ]\n"; + printf "Copyright (C) 2000 Christoph Kron\n"; + printf "check_ifoperstatus.pl comes with ABSOLUTELY NO WARRANTY\n"; + printf "This programm 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 Nagios monitors operational \n"; - printf "status of a particular network interface on the target host\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"; @@ -278,18 +300,20 @@ sub print_help() { 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)"; + 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 " 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 " -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 " 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 " -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"; @@ -299,12 +323,11 @@ sub print_help() { 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 must be specified\n\n"; - printf "Note: either -k or -d must be specified and -d is much more network \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"; - print_revision($PROGNAME, '$Revision: 1642 $'); } @@ -319,6 +342,7 @@ sub process_arguments() { "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, @@ -331,17 +355,17 @@ sub process_arguments() { "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{'OK'}; } - + if ($opt_V) { - print_revision($PROGNAME,'$Revision: 1642 $ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -351,19 +375,14 @@ sub process_arguments() { } if (! utils::is_hostname($hostname)){ - usage(); - exit $ERRORS{"UNKNOWN"}; + usage("Hostname invalid or not given"); } - - unless ($snmpkey > 0 || defined $ifdescr){ - printf "Either a valid snmpkey key (-k) or a ifDescr (-d) must be provided)\n"; - usage(); - exit $ERRORS{"UNKNOWN"}; + unless ($snmpkey > 0 || defined $ifdescr || defined $iftype){ + usage("Either a valid snmp key (-k) or a ifDescr (-d) must be provided"); } - - if (defined $name) { + if (defined $ifName) { $ifXTable=1; } @@ -378,128 +397,76 @@ sub process_arguments() { $timeout = $TIMEOUT; } - if ($snmp_version =~ /3/ ) { - # Must define a security level even though default is noAuthNoPriv - # v3 requires a security username - if (defined $seclevel && defined $secname) { - - # Must define a security level even though defualt is noAuthNoPriv - unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) { - usage(); - exit $ERRORS{"UNKNOWN"}; - } - - # Authentication wanted - if ( $seclevel eq 'authNoPriv' || $seclevel eq 'authPriv' ) { - - unless ( $authproto eq 'MD5' || $authproto eq 'SHA1' ) { - usage(); - exit $ERRORS{"UNKNOWN"}; - } - - if ( !defined $authpass) { - usage(); - exit $ERRORS{"UNKNOWN"}; - }else{ - if ($authpass =~ /^0x/ ) { - $auth = "-authkey => $authpass" ; - }else{ - $auth = "-authpassword => $authpass"; - } - } - - } - - # Privacy (DES encryption) wanted - if ($seclevel eq 'authPriv' ) { - if (! defined $privpass) { - usage(); - exit $ERRORS{"UNKNOWN"}; - }else{ - if ($privpass =~ /^0x/){ - $priv = "-privkey => $privpass"; - }else{ - $priv = "-privpassword => $privpass"; - } - } - } - - # Context name defined or default - - unless ( defined $context) { - $context = ""; - } - - - - }else { - usage(); - exit $ERRORS{'UNKNOWN'}; ; - } - } # end snmpv3 - - - if ( $snmp_version =~ /[12]/ ) { - ($session, $error) = Net::SNMP->session( - -hostname => $hostname, - -community => $community, - -port => $port, - -version => $snmp_version, - -maxmsgsize => $maxmsgsize - ); - - if (!defined($session)) { - $state='UNKNOWN'; - $answer=$error; - print ("$state: $answer"); - exit $ERRORS{$state}; - } - - }elsif ( $snmp_version =~ /3/ ) { - - if ($seclevel eq 'noAuthNoPriv') { - ($session, $error) = Net::SNMP->session( - -hostname => $hostname, - -port => $port, - -version => $snmp_version, - -username => $secname, - ); - - }elsif ( $seclevel eq 'authNoPriv' ) { - ($session, $error) = Net::SNMP->session( - -hostname => $hostname, - -port => $port, - -version => $snmp_version, - -username => $secname, - $auth, - -authprotocol => $authproto, - ); - }elsif ($seclevel eq 'authPriv' ) { - ($session, $error) = Net::SNMP->session( - -hostname => $hostname, - -port => $port, - -version => $snmp_version, - -username => $secname, - $auth, - -authprotocol => $authproto, - $priv - ); - } - - - if (!defined($session)) { - $state='UNKNOWN'; - $answer=$error; - print ("$state: $answer"); - exit $ERRORS{$state}; - } - - }else{ + 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 defualt 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 index 477c3b8..2263823 100755 --- a/plugins-scripts/check_ifstatus.pl +++ b/plugins-scripts/check_ifstatus.pl @@ -29,7 +29,6 @@ # # 11.01.2000 Version 1.0 # -# $Id: check_ifstatus.pl 884 2004-08-18 19:51:35Z tonvoon $ use POSIX; use strict; @@ -43,7 +42,8 @@ Getopt::Long::Configure('bundling'); my $PROGNAME = "check_ifstatus"; sub print_help (); -sub usage (); +sub usage ($); +sub print_usage (); sub process_arguments (); @@ -64,7 +64,7 @@ my $snmpoid=0; my $key=0; my $community = "public"; my $maxmsgsize = 1472 ; # Net::SNMP default is 1472 -my ($seclevel, $authproto, $secname, $authpass, $privpass, $auth, $priv, $context); +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'; @@ -93,6 +93,7 @@ my $opt_u; my $opt_x ; my %excluded ; my @unused_ports ; +my %session_opts; @@ -116,6 +117,15 @@ if ($status != 0) 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); @@ -210,19 +220,25 @@ my $perfdata = sprintf("up=%d,down=%d,dormant=%d,excluded=%d,unused=%d",$ifup,$i print ("$state: $answer |$perfdata\n"); exit $ERRORS{$state}; - -sub usage (){ - printf "\nMissing arguments!\n"; - printf "\n"; - printf "check_ifstatus -C -p -H \n"; - printf "Copyright (C) 2000 Christoph Kron\n"; - printf "Updates 5/2002 Subhendu Ghosh\n"; - printf "\n\n"; - support(); +sub usage($) { + print "$_[0]\n"; + print_usage(); exit $ERRORS{"UNKNOWN"}; } -sub print_help (){ +sub print_usage() { + printf "\n"; + printf "usage: \n"; + printf "check_ifstatus -C -p -H \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 Nagios monitors operational \n"; printf "status of each network interface on the target host\n"; printf "\nUsage:\n"; @@ -243,19 +259,20 @@ sub print_help (){ 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)"; + 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 " 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 " -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 " 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 - usefull 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, '$Revision: 884 $'); + print_revision($PROGNAME, '@NP_VERSION@'); } @@ -270,6 +287,7 @@ sub process_arguments() { "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, @@ -281,11 +299,12 @@ sub process_arguments() { ); if ($status == 0){ - print_help() ; + print_help(); exit $ERRORS{'OK'}; } + if ($opt_V) { - print_revision($PROGNAME,'$Revision: 884 $ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -298,68 +317,75 @@ sub process_arguments() { $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) { + if (defined $seclevel && defined $secname) { + $session_opts{'-username'} = $secname; # Must define a security level even though defualt is noAuthNoPriv - unless ($seclevel eq ('noAuthNoPriv' || 'authNoPriv' || 'authPriv' ) ) { - usage(); - exit $ERRORS{"UNKNOWN"}; + 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' || 'authPriv') ) { - - unless ($authproto eq ('MD5' || 'SHA1') ) { - usage(); - exit $ERRORS{"UNKNOWN"}; + 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(); - exit $ERRORS{"UNKNOWN"}; + usage("Auth password/key is not defined"); }else{ if ($authpass =~ /^0x/ ) { - $auth = "-authkey => $authpass" ; + $session_opts{'-authkey'} = $authpass ; }else{ - $auth = "-authpassword => $authpass"; + $session_opts{'-authpassword'} = $authpass ; } } - } # Privacy (DES encryption) wanted - if ($seclevel eq 'authPriv' ) { + if ($seclevel eq 'authPriv' ) { if (! defined $privpass) { - usage(); - exit $ERRORS{"UNKNOWN"}; + usage("Privacy passphrase/key is not defined"); }else{ if ($privpass =~ /^0x/){ - $priv = "-privkey => $privpass"; + $session_opts{'-privkey'} = $privpass; }else{ - $priv = "-privpassword => $privpass"; + $session_opts{'-privpassword'} = $privpass; } } + + $session_opts{'-privprotocol'} = $privproto if(defined $privproto); } # Context name defined or default - unless ( defined $context) { $context = ""; } - - }else { - usage(); - exit $ERRORS{'UNKNOWN'}; ; + usage("Security level or name is not defined"); } } # end snmpv3 - # for snmp v1 & v2c we default to community = "public" - # Excluded interfaces types (ifType) (backup interfaces, dial-on demand interfaces, PPP interfaces if (defined $opt_x) { my @x = split(/,/, $opt_x); @@ -381,79 +407,16 @@ sub process_arguments() { } if (! utils::is_hostname($hostname)){ - usage(); + usage("Hostname invalid or not given"); exit $ERRORS{"UNKNOWN"}; } - # create SNMP session handle based on options passed. - - if ( ! $snmp_version ) { - $snmp_version =1 ; - }else{ - if ( $snmp_version =~ /[12]/ ) { - - ($session, $error) = Net::SNMP->session( - -hostname => $hostname, - -community => $community, - -port => $port, - -version => $snmp_version, - -maxmsgsize => $maxmsgsize - ); - - if (!defined($session)) { - $state='UNKNOWN'; - $answer=$error; - print ("$state: $answer"); - exit $ERRORS{$state}; - } - - }elsif ( $snmp_version =~ /3/ ) { - - if ($seclevel eq 'noAuthNoPriv') { - ($session, $error) = Net::SNMP->session( - -hostname => $hostname, - -port => $port, - -version => $snmp_version, - -username => $secname, - ); - - }elsif ( $seclevel eq 'authNoPriv' ) { - ($session, $error) = Net::SNMP->session( - -hostname => $hostname, - -port => $port, - -version => $snmp_version, - -username => $secname, - -authprotocol => $authproto, - $auth - ); - }elsif ($seclevel eq 'authPriv' ) { - ($session, $error) = Net::SNMP->session( - -hostname => $hostname, - -port => $port, - -version => $snmp_version, - -username => $secname, - -authprotocol => $authproto, - $auth, - $priv - ); - } - - - if (!defined($session)) { - $state='UNKNOWN'; - $answer=$error; - print ("$state: $answer"); - exit $ERRORS{$state}; - } - - }else{ + 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 index 7278391..cc730cf 100755 --- a/plugins-scripts/check_ircd.pl +++ b/plugins-scripts/check_ircd.pl @@ -7,7 +7,6 @@ # # Date: 1999/09/20 # -# $Id: check_ircd.pl 22 2002-05-07 05:35:49Z sghosh $ # # Description: This script will check to see if an IRCD is running # about how many users it has @@ -119,7 +118,7 @@ sub print_usage () { sub print_help () { - print_revision($PROGNAME,'$Revision: 22 $ '); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Richard Mayhew/Karl DeBisschop Perl Check IRCD plugin for Nagios @@ -190,7 +189,7 @@ MAIN: "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 22 $ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh index 3e051e6..a1bfb48 100755 --- a/plugins-scripts/check_log.sh +++ b/plugins-scripts/check_log.sh @@ -71,7 +71,7 @@ TOUCH="/bin/touch" PROGNAME=`/bin/basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision: 1749 $' | sed -e 's/[^0-9.]//g'` +REVISION="@NP_VERSION@" . $PROGPATH/utils.sh diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index 8815aaf..31eb46a 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl @@ -22,7 +22,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -# $Id: check_mailq.pl 1443 2006-07-05 13:45:57Z tonvoon $ # ############################################################################ @@ -522,7 +521,7 @@ sub process_arguments(){ ); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 1443 $ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -580,7 +579,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1443 $'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2002 Subhendu Ghosh/Carlos Canau/Benjamin Schmid\n"; print "\n"; print_usage(); @@ -588,7 +587,7 @@ sub print_help () { 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 queu to generate critical alert ( w < c )\n"; + print "-c (--critical) = Min. number of messages in queue to generate critical alert ( w < c )\n"; print "-W (--Warning) = Min. number of messages for same domain in queue to generate warning\n"; print "-C (--Critical) = 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"; diff --git a/plugins-scripts/check_ntp.pl b/plugins-scripts/check_ntp.pl index 6fdceb7..5c87e0a 100755 --- a/plugins-scripts/check_ntp.pl +++ b/plugins-scripts/check_ntp.pl @@ -7,7 +7,6 @@ # be installed on the system, however since it's part of the ntp suite, you # should already have it installed. # -# $Id: check_ntp.pl 1291 2005-11-30 00:49:47Z harpermann $ # # Nothing clever done in this program - its a very simple bare basics hack to # get the job done. @@ -97,7 +96,7 @@ GetOptions "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 1291 $ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -443,7 +442,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 1291 $'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2003 Bo Kersey/Karl DeBisschop\n"; print "\n"; print_usage(); diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index bab2daa..664795e 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh @@ -8,7 +8,7 @@ PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision: 1749 $' | sed -e 's/[^0-9.]//g'` +REVISION="@NP_VERSION@" . $PROGPATH/utils.sh diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl index 192c8b6..d2701e9 100755 --- a/plugins-scripts/check_rpc.pl +++ b/plugins-scripts/check_rpc.pl @@ -15,10 +15,8 @@ # # initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop # Modified May 2002 Subhendu Ghosh - support for ePN and patches -# current status: $Revision: 677 $ # # Copyright Notice: GPL -# $Id: check_rpc.pl 677 2003-08-10 12:11:49Z kdebisschop $ # use strict; @@ -38,13 +36,13 @@ sub print_help (); sub print_usage (); sub in ($$); -$ENV{'BASH_ENV'}=''; +$ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; $ENV{'PATH'}=''; $ENV{'LC_ALL'}='C'; #Initialise protocol for each progname number -# 'u' for UDP, 't' for TCP +# 'u' for UDP, 't' for TCP $proto[10003]='u'; $proto[10004]='u'; $proto[10007]='u'; @@ -67,9 +65,9 @@ GetOptions( if ($opt_h) { print_help(); exit $ERRORS{'OK'}; } # -V means display version number -if ($opt_V) { - print_revision($PROGNAME,'$Revision: 677 $ '); - exit $ERRORS{'OK'}; +if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'OK'}; } # Hash containing all RPC program names and numbers @@ -275,7 +273,7 @@ if (defined $opt_c ) { }else{ print "Version $vers is not an integer\n" if $verbose; } - + } }else{ get_rpcinfo(); @@ -311,7 +309,7 @@ sub get_rpcinfo { while ( $line = ) { 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'; @@ -336,7 +334,7 @@ sub get_rpcinfo { sub print_help() { - print_revision($PROGNAME,'$Revision: 677 $ '); + 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"; diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh index 8df3ed9..ae80fc4 100755 --- a/plugins-scripts/check_sensors.sh +++ b/plugins-scripts/check_sensors.sh @@ -4,7 +4,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision: 162 $' | sed -e 's/[^0-9.]//g'` +REVISION="@NP_VERSION@" . $PROGPATH/utils.sh diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl index 7aeef72..2671112 100755 --- a/plugins-scripts/check_wave.pl +++ b/plugins-scripts/check_wave.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl -wT # -# $Id: check_wave.pl 162 2002-10-28 13:05:08Z kdebisschop $ use strict; @@ -30,7 +29,7 @@ GetOptions "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 162 $'); #' + print_revision($PROGNAME,'@NP_VERSION@'); #' exit $ERRORS{'OK'}; } @@ -112,7 +111,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision: 162 $'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Jeffery Blank/Karl DeBisschop\n"; print "\n"; print_usage(); diff --git a/plugins-scripts/subst.in b/plugins-scripts/subst.in index 8986868..a70ad88 100644 --- a/plugins-scripts/subst.in +++ b/plugins-scripts/subst.in @@ -37,6 +37,9 @@ BEGIN { } +# Plugin revision +/@NP_VERSION@/ {sub(/@NP_VERSION@/,ENVIRON["NP_VERSION"]);} + # scripting language (first line) /^#! ?\/.*\/python/ {sub(/^#! ?\/.*\/python/,"#! @PYTHON@");} @@ -44,6 +47,17 @@ BEGIN { /^#! ?\/.*\/[a-z]{0,2}awk/ {sub(/^#! ?\/.*\/[a-z]{0,2}awk/,"#! @AWK@");} /^#! ?\/.*\/sh/ {sub(/^#! ?\/.*\/sh/,"#! @SHELL@");} +# If a script contains a reference to a fully qualified command, +# subst will replace the fully qualified command with whatever is +# returned from the which subroutine. run before changes to INC to add libexecdir +# FIXME: Prepend executables with a substitution keyword instead. +# +/^[^#]/ && /(\/.*)?\/(bin|sbin|lib|libexec)\// { + match($0,/(\/.*)?\/(bin|sbin|lib|libexec)\/[-_a-zA-Z0-9]+/); + c=substr($0,RSTART,RLENGTH); + sub(c,which(c,path)); +} + # add to libexecdir to INC for perl utils.pm /^use/ { if (/lib/) { if (/utils.pm|"."/ ) {sub(/utils.pm|"."/,led() )} } } @@ -58,16 +72,6 @@ BEGIN { sub(/\=.*$/,"='@with_trusted_path@' # autoconf-derived"); } -# If a script contains a reference to a fully qualified command, -# subst will replace the fully qualified command with whatever is -# returned from the which subroutine -# -/^[^#]/ && /(\/.*)?\/(bin|sbin|lib|libexec)\// { - match($0,/(\/.*)?\/(bin|sbin|lib|libexec)\/[-_a-zA-Z0-9]+/); - c=substr($0,RSTART,RLENGTH); - sub(c,which(c,path)); -} - { print; } diff --git a/plugins-scripts/t/check_file_age.t b/plugins-scripts/t/check_file_age.t index afa20af..384c276 100644 --- a/plugins-scripts/t/check_file_age.t +++ b/plugins-scripts/t/check_file_age.t @@ -2,7 +2,6 @@ # # check_file_age tests # -# $Id: check_file_age.t 1297 2005-12-15 15:17:49Z tonvoon $ # use strict; 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_rpc.t b/plugins-scripts/t/check_rpc.t index 35bfe56..be8ae2f 100644 --- a/plugins-scripts/t/check_rpc.t +++ b/plugins-scripts/t/check_rpc.t @@ -2,7 +2,6 @@ # # Remote Procedure Call (RPC) Tests via check_rpc # -# $Id: check_rpc.t 1207 2005-07-25 01:47:15Z illumino $ # use strict; diff --git a/plugins-scripts/t/utils.t b/plugins-scripts/t/utils.t index 2e1fd48..9c2c569 100644 --- a/plugins-scripts/t/utils.t +++ b/plugins-scripts/t/utils.t @@ -2,7 +2,6 @@ # # utils.pm tests # -# $Id: utils.t 1549 2006-12-12 12:59:06Z tonvoon $ # # Run with perl t/utils.t diff --git a/plugins-scripts/utils.pm.in b/plugins-scripts/utils.pm.in index b8bab62..37cd62c 100644 --- a/plugins-scripts/utils.pm.in +++ b/plugins-scripts/utils.pm.in @@ -1,5 +1,4 @@ # Utility drawer for Nagios plugins. -# $Id: utils.pm.in 1751 2007-07-07 11:55:48Z psychotrahe $ # # This will be deprecated soon. Please use Nagios::Plugin from CPAN # for new plugins @@ -32,8 +31,6 @@ $TIMEOUT = 15; sub print_revision ($$) { my $commandName = shift; my $pluginRevision = shift; - $pluginRevision =~ s/^\$Revision: //; - $pluginRevision =~ s/ \$\s*$//; print "$commandName v$pluginRevision (@PACKAGE@ @VERSION@)\n"; print "@WARRANTY@"; } diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 67c49ca..37de753 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -1,5 +1,16 @@ ## Process this file with automake to produce Makefile.in +if RELEASE_PRESENT +NP_VERSION = $(PACKAGE_VERSION) +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 INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl @LDAPINCLUDE@ @PGINCLUDE@ @SSLINCLUDE@ @@ -65,10 +76,10 @@ check_ldap_LDADD = $(NETLIBS) $(LDAPLIBS) check_load_LDADD = $(BASEOBJS) popen.o check_mrtg_LDADD = $(BASEOBJS) check_mrtgtraf_LDADD = $(BASEOBJS) -check_mysql_CFLAGS = $(MYSQLCFLAGS) +check_mysql_CFLAGS = $(MYSQLCFLAGS) -DNP_VERSION='"$(NP_VERSION)"' check_mysql_CPPFLAGS = $(MYSQLINCLUDE) check_mysql_LDADD = $(NETLIBS) $(MYSQLLIBS) -check_mysql_query_CFLAGS = $(MYSQLCFLAGS) +check_mysql_query_CFLAGS = $(MYSQLCFLAGS) -DNP_VERSION='"$(NP_VERSION)"' check_mysql_query_CPPFLAGS = $(MYSQLINCLUDE) check_mysql_query_LDADD = $(NETLIBS) $(MYSQLLIBS) check_nagios_LDADD = $(BASEOBJS) runcmd.o @@ -79,10 +90,10 @@ check_nwstat_LDADD = $(NETLIBS) check_overcr_LDADD = $(NETLIBS) check_pgsql_LDADD = $(NETLIBS) $(PGLIBS) check_ping_LDADD = $(NETLIBS) popen.o -check_procs_LDADD = $(BASEOBJS) popen.o +check_procs_LDADD = $(BASEOBJS) check_radius_LDADD = $(NETLIBS) $(RADIUSLIBS) check_real_LDADD = $(NETLIBS) -check_snmp_LDADD = $(BASEOBJS) popen.o +check_snmp_LDADD = $(BASEOBJS) check_smtp_LDADD = $(SSLOBJS) $(NETLIBS) $(SSLLIBS) check_ssh_LDADD = $(NETLIBS) check_swap_LDADD = $(MATHLIBS) $(BASEOBJS) popen.o @@ -91,7 +102,7 @@ check_time_LDADD = $(NETLIBS) check_ntp_time_LDADD = $(NETLIBS) $(MATHLIBS) check_ups_LDADD = $(NETLIBS) check_users_LDADD = $(BASEOBJS) popen.o -check_by_ssh_LDADD = $(NETLIBS) runcmd.o +check_by_ssh_LDADD = $(NETLIBS) check_ide_smart_LDADD = $(BASEOBJS) negate_LDADD = $(BASEOBJS) urlize_LDADD = $(BASEOBJS) popen.o @@ -124,7 +135,7 @@ check_ping_DEPENDENCIES = check_ping.c $(NETOBJS) popen.o $(DEPLIBS) check_procs_DEPENDENCIES = check_procs.c $(BASEOBJS) popen.o $(DEPLIBS) check_radius_DEPENDENCIES = check_radius.c $(NETOBJS) $(DEPLIBS) check_real_DEPENDENCIES = check_real.c $(NETOBJS) $(DEPLIBS) -check_snmp_DEPENDENCIES = check_snmp.c $(BASEOBJS) popen.o $(DEPLIBS) +check_snmp_DEPENDENCIES = check_snmp.c $(BASEOBJS) $(DEPLIBS) check_smtp_DEPENDENCIES = check_smtp.c $(SSLOBJS) $(NETOBJS) $(DEPLIBS) check_ssh_DEPENDENCIES = check_ssh.c $(NETOBJS) $(DEPLIBS) check_swap_DEPENDENCIES = check_swap.c $(BASEOBJS) popen.o $(DEPLIBS) @@ -133,7 +144,7 @@ check_time_DEPENDENCIES = check_time.c $(NETOBJS) $(DEPLIBS) check_ntp_time_DEPENDENCIES = check_ntp_time.c $(NETOBJS) $(DEPLIBS) check_ups_DEPENDENCIES = check_ups.c $(NETOBJS) $(DEPLIBS) check_users_DEPENDENCIES = check_users.c $(BASEOBJS) popen.o $(DEPLIBS) -check_by_ssh_DEPENDENCIES = check_by_ssh.c $(NETOBJS) runcmd.o $(DEPLIBS) +check_by_ssh_DEPENDENCIES = check_by_ssh.c $(NETOBJS) $(DEPLIBS) negate_DEPENDENCIES = negate.c $(BASEOBJS) $(DEPLIBS) urlize_DEPENDENCIES = urlize.c $(BASEOBJS) popen.o $(DEPLIBS) @@ -149,10 +160,6 @@ utils.o: utils.c utils.h $(PLUGINHDRS) netutils.o: netutils.c netutils.h $(PLUGINHDRS) sslutils.o: sslutils.c netutils.h $(PLUGINHDRS) -getaddrinfo.o: getaddrinfo.h $(PLUGINHDRS) - -gethostbyname.o: gethostbyname.h $(PLUGINHDRS) - all-local: $(check_tcp_programs) $(check_tcp_programs): check_tcp @@ -166,6 +173,8 @@ install-exec-hook: 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 index c4ff31e..5a1160d 100644 --- a/plugins/Makefile.in +++ b/plugins/Makefile.in @@ -54,17 +54,19 @@ subdir = plugins DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ - $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/00gnulib.m4 $(top_srcdir)/gl/m4/alloca.m4 \ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ - $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \ - $(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \ - $(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \ + $(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \ + $(top_srcdir)/gl/m4/dos.m4 \ $(top_srcdir)/gl/m4/double-slash-root.m4 \ - $(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \ + $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \ $(top_srcdir)/gl/m4/exitfail.m4 \ $(top_srcdir)/gl/m4/extensions.m4 \ $(top_srcdir)/gl/m4/fcntl-safer.m4 \ - $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/float_h.m4 \ + $(top_srcdir)/gl/m4/floorf.m4 \ $(top_srcdir)/gl/m4/fstypename.m4 \ $(top_srcdir)/gl/m4/fsusage.m4 \ $(top_srcdir)/gl/m4/getaddrinfo.m4 \ @@ -74,7 +76,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/glibc21.m4 \ $(top_srcdir)/gl/m4/gnulib-common.m4 \ $(top_srcdir)/gl/m4/gnulib-comp.m4 \ - $(top_srcdir)/gl/m4/iconv.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/iconv.m4 \ $(top_srcdir)/gl/m4/include_next.m4 \ $(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \ $(top_srcdir)/gl/m4/intlmacosx.m4 \ @@ -83,17 +85,24 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \ $(top_srcdir)/gl/m4/lib-prefix.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/longlong.m4 \ $(top_srcdir)/gl/m4/ls-mntd-fs.m4 \ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \ - $(top_srcdir)/gl/m4/mbstate_t.m4 \ + $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mktime.m4 \ $(top_srcdir)/gl/m4/mountlist.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/nls.m4 \ - $(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \ + $(top_srcdir)/gl/m4/onceonly.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \ $(top_srcdir)/gl/m4/safe-read.m4 \ $(top_srcdir)/gl/m4/safe-write.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/servent.m4 $(top_srcdir)/gl/m4/size_max.m4 \ $(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \ @@ -103,13 +112,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \ $(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \ $(top_srcdir)/gl/m4/strnlen.m4 \ $(top_srcdir)/gl/m4/sys_socket_h.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/unistd-safer.m4 \ $(top_srcdir)/gl/m4/unistd_h.m4 \ $(top_srcdir)/gl/m4/vasnprintf.m4 \ $(top_srcdir)/gl/m4/vasprintf.m4 \ $(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \ - $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \ - $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \ + $(top_srcdir)/gl/m4/wctype.m4 $(top_srcdir)/gl/m4/wint_t.m4 \ + $(top_srcdir)/gl/m4/write.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -249,6 +261,7 @@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ @@ -280,16 +293,24 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +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@ F77 = @F77@ +FCNTL_H = @FCNTL_H@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ @@ -298,47 +319,85 @@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CEILF = @GNULIB_CEILF@ GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ GNULIB_FLOORF = @GNULIB_FLOORF@ GNULIB_FLOORL = @GNULIB_FLOORL@ GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPL = @GNULIB_FREXPL@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTELL = @GNULIB_FTELL@ GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -348,18 +407,37 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ GNULIB_ROUND = @GNULIB_ROUND@ GNULIB_ROUNDF = @GNULIB_ROUNDF@ GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ @@ -372,32 +450,57 @@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_TRUNC = @GNULIB_TRUNC@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ 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_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ @@ -410,25 +513,46 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_TANL = @HAVE_DECL_TANL@ HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_OS_H = @HAVE_OS_H@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ @@ -442,8 +566,16 @@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +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_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_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@ @@ -451,14 +583,20 @@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +HOSTENT_LIB = @HOSTENT_LIB@ HOSTNAME = @HOSTNAME@ INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -481,6 +619,10 @@ LIBS = @LTLIBINTL@ @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -493,15 +635,21 @@ MYSQLCFLAGS = @MYSQLCFLAGS@ MYSQLINCLUDE = @MYSQLINCLUDE@ MYSQLLIBS = @MYSQLLIBS@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_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@ @@ -543,16 +691,23 @@ PKG_ARCH = @PKG_ARCH@ PLUGIN_TEST = @PLUGIN_TEST@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PST3CFLAGS = @PST3CFLAGS@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ PYTHON = @PYTHON@ RADIUSLIBS = @RADIUSLIBS@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ +RELEASE_PRESENT_FALSE = @RELEASE_PRESENT_FALSE@ +RELEASE_PRESENT_TRUE = @RELEASE_PRESENT_TRUE@ +REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -568,12 +723,28 @@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LSEEK = @REPLACE_LSEEK@ +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_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_ROUND = @REPLACE_ROUND@ @@ -583,19 +754,32 @@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRPTIME = @REPLACE_STRPTIME@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ 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_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ REV_DATESTAMP = @REV_DATESTAMP@ REV_TIMESTAMP = @REV_TIMESTAMP@ SCRIPT_TEST = @SCRIPT_TEST@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ @@ -609,6 +793,11 @@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_LIBTAP_LOCAL_FALSE = @USE_LIBTAP_LOCAL_FALSE@ +USE_LIBTAP_LOCAL_TRUE = @USE_LIBTAP_LOCAL_TRUE@ USE_NLS = @USE_NLS@ USE_PARSE_INI_FALSE = @USE_PARSE_INI_FALSE@ USE_PARSE_INI_TRUE = @USE_PARSE_INI_TRUE@ @@ -676,6 +865,8 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ with_trusted_path = @with_trusted_path@ +@RELEASE_PRESENT_TRUE@NP_VERSION = $(PACKAGE_VERSION) +AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"' INCLUDES = -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@ @@ -707,10 +898,10 @@ check_ldap_LDADD = $(NETLIBS) $(LDAPLIBS) check_load_LDADD = $(BASEOBJS) popen.o check_mrtg_LDADD = $(BASEOBJS) check_mrtgtraf_LDADD = $(BASEOBJS) -check_mysql_CFLAGS = $(MYSQLCFLAGS) +check_mysql_CFLAGS = $(MYSQLCFLAGS) -DNP_VERSION='"$(NP_VERSION)"' check_mysql_CPPFLAGS = $(MYSQLINCLUDE) check_mysql_LDADD = $(NETLIBS) $(MYSQLLIBS) -check_mysql_query_CFLAGS = $(MYSQLCFLAGS) +check_mysql_query_CFLAGS = $(MYSQLCFLAGS) -DNP_VERSION='"$(NP_VERSION)"' check_mysql_query_CPPFLAGS = $(MYSQLINCLUDE) check_mysql_query_LDADD = $(NETLIBS) $(MYSQLLIBS) check_nagios_LDADD = $(BASEOBJS) runcmd.o @@ -721,10 +912,10 @@ check_nwstat_LDADD = $(NETLIBS) check_overcr_LDADD = $(NETLIBS) check_pgsql_LDADD = $(NETLIBS) $(PGLIBS) check_ping_LDADD = $(NETLIBS) popen.o -check_procs_LDADD = $(BASEOBJS) popen.o +check_procs_LDADD = $(BASEOBJS) check_radius_LDADD = $(NETLIBS) $(RADIUSLIBS) check_real_LDADD = $(NETLIBS) -check_snmp_LDADD = $(BASEOBJS) popen.o +check_snmp_LDADD = $(BASEOBJS) check_smtp_LDADD = $(SSLOBJS) $(NETLIBS) $(SSLLIBS) check_ssh_LDADD = $(NETLIBS) check_swap_LDADD = $(MATHLIBS) $(BASEOBJS) popen.o @@ -733,7 +924,7 @@ check_time_LDADD = $(NETLIBS) check_ntp_time_LDADD = $(NETLIBS) $(MATHLIBS) check_ups_LDADD = $(NETLIBS) check_users_LDADD = $(BASEOBJS) popen.o -check_by_ssh_LDADD = $(NETLIBS) runcmd.o +check_by_ssh_LDADD = $(NETLIBS) check_ide_smart_LDADD = $(BASEOBJS) negate_LDADD = $(BASEOBJS) urlize_LDADD = $(BASEOBJS) popen.o @@ -765,7 +956,7 @@ check_ping_DEPENDENCIES = check_ping.c $(NETOBJS) popen.o $(DEPLIBS) check_procs_DEPENDENCIES = check_procs.c $(BASEOBJS) popen.o $(DEPLIBS) check_radius_DEPENDENCIES = check_radius.c $(NETOBJS) $(DEPLIBS) check_real_DEPENDENCIES = check_real.c $(NETOBJS) $(DEPLIBS) -check_snmp_DEPENDENCIES = check_snmp.c $(BASEOBJS) popen.o $(DEPLIBS) +check_snmp_DEPENDENCIES = check_snmp.c $(BASEOBJS) $(DEPLIBS) check_smtp_DEPENDENCIES = check_smtp.c $(SSLOBJS) $(NETOBJS) $(DEPLIBS) check_ssh_DEPENDENCIES = check_ssh.c $(NETOBJS) $(DEPLIBS) check_swap_DEPENDENCIES = check_swap.c $(BASEOBJS) popen.o $(DEPLIBS) @@ -774,7 +965,7 @@ check_time_DEPENDENCIES = check_time.c $(NETOBJS) $(DEPLIBS) check_ntp_time_DEPENDENCIES = check_ntp_time.c $(NETOBJS) $(DEPLIBS) check_ups_DEPENDENCIES = check_ups.c $(NETOBJS) $(DEPLIBS) check_users_DEPENDENCIES = check_users.c $(BASEOBJS) popen.o $(DEPLIBS) -check_by_ssh_DEPENDENCIES = check_by_ssh.c $(NETOBJS) runcmd.o $(DEPLIBS) +check_by_ssh_DEPENDENCIES = check_by_ssh.c $(NETOBJS) $(DEPLIBS) negate_DEPENDENCIES = negate.c $(BASEOBJS) $(DEPLIBS) urlize_DEPENDENCIES = urlize.c $(BASEOBJS) popen.o $(DEPLIBS) all: all-am @@ -1313,6 +1504,10 @@ uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS \ tags uninstall uninstall-am uninstall-info-am \ uninstall-libexecPROGRAMS uninstall-local +@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 @@ -1332,10 +1527,6 @@ utils.o: utils.c utils.h $(PLUGINHDRS) netutils.o: netutils.c netutils.h $(PLUGINHDRS) sslutils.o: sslutils.c netutils.h $(PLUGINHDRS) -getaddrinfo.o: getaddrinfo.h $(PLUGINHDRS) - -gethostbyname.o: gethostbyname.h $(PLUGINHDRS) - all-local: $(check_tcp_programs) $(check_tcp_programs): check_tcp @@ -1349,6 +1540,7 @@ install-exec-hook: 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/check_apt.c b/plugins/check_apt.c index b899eac..3da54bc 100644 --- a/plugins/check_apt.c +++ b/plugins/check_apt.c @@ -7,8 +7,6 @@ * * Original author: Sean Finney * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_apt plugin @@ -29,12 +27,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_apt.c 1991 2008-05-07 10:02:42Z dermoth $ -* *****************************************************************************/ const char *progname = "check_apt"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "2006-2008"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -116,7 +111,7 @@ int main (int argc, char **argv) { result = max_state(result, STATE_OK); } - printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"), + printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"), state_text(result), packages_available, (upgrade==DIST_UPGRADE)?"dist-upgrade":"upgrade", @@ -159,7 +154,7 @@ int process_arguments (int argc, char **argv) { print_help(); exit(STATE_OK); case 'V': - print_revision(progname, revision); + print_revision(progname, NP_VERSION); exit(STATE_OK); case 'v': verbose++; @@ -305,7 +300,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ } regfree(&ireg); regfree(&sreg); - if(do_exclude!=NULL) regfree(&ereg); + if(do_exclude!=NULL) regfree(&ereg); free(cmdline); return result; } @@ -364,7 +359,7 @@ char* add_to_regexp(char *expr, const char *next){ sprintf((char*)(re+strlen(re)-2), "|%s) ", next); } - return re; + return re; } char* construct_cmdline(upgrade_type u, const char *opts){ @@ -404,7 +399,7 @@ char* construct_cmdline(upgrade_type u, const char *opts){ void print_help (void) { - print_revision(progname, revision); + print_revision(progname, NP_VERSION); printf(_(COPYRIGHT), copyright, email); diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c index 007fe49..793c03d 100644 --- a/plugins/check_by_ssh.c +++ b/plugins/check_by_ssh.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 2000-2008 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-27 22:31:13 +0100 (Tue, 27 May 2008) $ -* * Description: * * This file contains the check_by_ssh plugin @@ -25,22 +23,25 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_by_ssh.c 2002 2008-05-27 21:31:13Z tonvoon $ * *****************************************************************************/ const char *progname = "check_by_ssh"; -const char *revision = "$Revision: 2002 $"; const char *copyright = "2000-2008"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" -#include "netutils.h" #include "utils.h" -#include "runcmd.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); @@ -49,7 +50,8 @@ unsigned int services = 0; int skip_stdout = 0; int skip_stderr = 0; char *remotecmd = NULL; -char *comm = NULL; +char **commargv = NULL; +int commargc = 0; char *hostname = NULL; char *outputfile = NULL; char *host_shortname = NULL; @@ -67,10 +69,10 @@ main (int argc, char **argv) int i; time_t local_time; FILE *fp = NULL; - struct output chld_out, chld_err; + output chld_out, chld_err; remotecmd = ""; - comm = strdup (SSH_COMMAND); + comm_append(SSH_COMMAND); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); @@ -84,16 +86,19 @@ main (int argc, char **argv) usage_va(_("Could not parse arguments")); /* Set signal handling and alarm timeout */ - if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) { + if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) { usage_va(_("Cannot catch SIGALRM")); } alarm (timeout_interval); /* run the command */ - if (verbose) - printf ("%s\n", comm); + if (verbose) { + printf ("Command: %s\n", commargv[0]); + for (i=1; i 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) @@ -339,7 +375,7 @@ validate_arguments (void) void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Karl DeBisschop \n"); printf (COPYRIGHT, copyright, email); diff --git a/plugins/check_cluster.c b/plugins/check_cluster.c index f0d147a..0138588 100644 --- a/plugins/check_cluster.c +++ b/plugins/check_cluster.c @@ -6,9 +6,6 @@ * Copyright (c) 2000-2004 Ethan Galstad (nagios@nagios.org) * Copyright (c) 2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* -* * 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 @@ -22,12 +19,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_cluster.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ const char *progname = "check_cluster"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "2000-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -124,7 +119,7 @@ int main(int argc, char **argv){ } } } - + /* return the status of the cluster */ if(check_type==CHECK_SERVICES){ @@ -149,7 +144,7 @@ int main(int argc, char **argv){ int process_arguments(int argc, char **argv){ int c; int option=0; - static struct option longopts[]={ + static struct option longopts[]={ {"data", required_argument,0,'d'}, {"warning", required_argument,0,'w'}, {"critical", required_argument,0,'c'}, @@ -204,7 +199,7 @@ int process_arguments(int argc, char **argv){ break; case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); break; @@ -228,7 +223,7 @@ int process_arguments(int argc, char **argv){ void print_help(void) { - print_revision(progname, revision); + print_revision(progname, NP_VERSION); printf ("Copyright (c) 2000-2004 Ethan Galstad (nagios@nagios.org)\n"); printf(COPYRIGHT, copyright, email); diff --git a/plugins/check_dig.c b/plugins/check_dig.c index f1b6935..08be937 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 2002-2008 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_dig plugin @@ -25,7 +23,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_dig.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ @@ -36,7 +33,6 @@ * because on some architectures those strings are in non-writable memory */ const char *progname = "check_dig"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "2002-2008"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -143,8 +139,10 @@ main (int argc, char **argv) } } - if (result == STATE_UNKNOWN) + 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) { @@ -218,7 +216,7 @@ process_arguments (int argc, char **argv) print_help (); exit (STATE_OK); case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'H': /* hostname */ host_or_die(optarg); @@ -295,7 +293,10 @@ process_arguments (int argc, char **argv) int validate_arguments (void) { - return OK; + if (query_address != NULL) + return OK; + else + return ERROR; } @@ -307,7 +308,7 @@ print_help (void) asprintf (&myport, "%d", DEFAULT_PORT); - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 2000 Karl DeBisschop \n"); printf (COPYRIGHT, copyright, email); @@ -357,7 +358,7 @@ void print_usage (void) { printf (_("Usage:")); - printf ("%s -H -l [-p ]\n", progname); + printf ("%s -l [-H ] [-p ]\n", progname); printf (" [-T ] [-w ] [-c ]\n"); printf (" [-t ] [-a ] [-v]\n"); } diff --git a/plugins/check_disk.c b/plugins/check_disk.c index e3b63e7..5c0eec5 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 1999-2008 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_disk plugin @@ -25,13 +23,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_disk.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ const char *progname = "check_disk"; const char *program_name = "check_disk"; /* Required for coreutils libs */ -const char *revision = "$Revision: 1991 $"; const char *copyright = "1999-2008"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -118,9 +114,6 @@ enum #pragma alloca #endif -/* Linked list of mounted filesystems. */ -static struct mount_entry *mount_list; - int process_arguments (int, char **); void print_path (const char *mypath); void set_all_thresholds (struct parameter_list *path); @@ -201,7 +194,7 @@ main (int argc, char **argv) /* If a list of paths has not been selected, find entire mount list and create list of paths */ - if (path_selected == FALSE) { + if (path_selected == 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); @@ -227,11 +220,11 @@ main (int argc, char **argv) /* 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) + 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) + if (verbose >= 3 && path->group != NULL) printf("Group of %s: %s\n",path->name,path->group); /* reset disk result */ @@ -271,7 +264,7 @@ main (int argc, char **argv) fsp.fsu_files += tmpfsp.fsu_files; /* Total file nodes. */ fsp.fsu_ffree += tmpfsp.fsu_ffree; /* Free file nodes. */ - if (verbose > 3) + if (verbose >= 3) printf("Group %s: add %llu blocks (%s) \n", path->group, tmpfsp.fsu_bavail, temp_list->name); /* printf("Group %s: add %u blocks (%s)\n", temp_list->name); *//* path->group, tmpfsp.fsu_bavail, temp_list->name); */ @@ -296,8 +289,8 @@ main (int argc, char **argv) /* Skip excluded fstypes */ } else if (fs_exclude_list && np_find_name (fs_exclude_list, me->me_type)) { continue; - /* Skip excluded fs's */ - } else if (dp_exclude_list && + /* 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; @@ -330,7 +323,7 @@ main (int argc, char **argv) dfree_inodes_percent = 100 - dused_inodes_percent; if (verbose >= 3) { - printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n", + printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n", me->me_mountdir, dused_pct, dfree_pct, dused_units, dfree_units, dtotal_units, dused_inodes_percent, dfree_inodes_percent, fsp.fsu_blocksize, mult); } @@ -420,7 +413,7 @@ main (int argc, char **argv) } - if (verbose > 2) + if (verbose >= 2) asprintf (&output, "%s%s", output, details); @@ -433,7 +426,7 @@ 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 + if (value <= TYPE_MAXIMUM(uintmax_t) / 100 && total != 0) { uintmax_t u100 = value * 100; pct = u100 / total + (u100 % total != 0); @@ -477,8 +470,8 @@ process_arguments (int argc, char **argv) {"iwarning", required_argument, 0, 'W'}, /* Dang, -C is taken. We might want to reshuffle this. */ {"icritical", required_argument, 0, 'K'}, - {"kilobytes", required_argument, 0, 'k'}, - {"megabytes", required_argument, 0, 'm'}, + {"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'}, @@ -549,7 +542,7 @@ process_arguments (int argc, char **argv) } break; - /* Awful mistake where the range values do not make sense. Normally, + /* 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 artifically force @ at the beginning of the range, so that it is backwards compatible @@ -623,10 +616,10 @@ process_arguments (int argc, char **argv) case 'L': stat_remote_fs = 1; case 'l': - show_local_fs = 1; + show_local_fs = 1; break; case 'p': /* select path */ - if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || + 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 )) { @@ -639,8 +632,15 @@ process_arguments (int argc, char **argv) } se->group = group; set_all_thresholds(se); - np_set_best_match(se, mount_list, exact_match); + + /* With autofs, it is required to stat() the path before re-populating the mount_list */ stat_path(se); + /* 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 */ @@ -661,19 +661,19 @@ process_arguments (int argc, char **argv) break; case 'E': if (path_selected) - die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set -E before selecting pathes\n")); + die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set -E before selecting paths\n")); exact_match = TRUE; break; case 'g': if (path_selected) - die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set group value before selecting pathes \n")); + die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set group value before selecting paths\n")); group = optarg; break; case 'I': cflags |= REG_ICASE; case 'i': if (!path_selected) - die (STATE_UNKNOWN, "DISK %s: %s\n", _("UNKNOWN"), _("Pathes need to be selected before using -i/-I. Use -A to select all pathes explicitly")); + 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); @@ -713,7 +713,7 @@ process_arguments (int argc, char **argv) case 'R': cflags |= REG_ICASE; case 'r': - if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || + 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 )) { @@ -729,7 +729,7 @@ process_arguments (int argc, char **argv) for (me = mount_list; me; me = me->me_next) { if (np_regex_match_mount_entry(me, &re)) { fnd = TRUE; - if (verbose > 3) + 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 */ @@ -757,10 +757,9 @@ process_arguments (int argc, char **argv) case 'C': /* add all mount entries to path_select list if no partitions have been explicitly defined using -p */ if (path_selected == FALSE) { - struct mount_entry *me; struct parameter_list *path; for (me = mount_list; me; me = me->me_next) { - if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) + 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; @@ -784,7 +783,7 @@ process_arguments (int argc, char **argv) group = NULL; break; case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'h': /* help */ print_help (); @@ -819,7 +818,7 @@ process_arguments (int argc, char **argv) void -print_path (const char *mypath) +print_path (const char *mypath) { if (mypath == NULL) printf ("\n"); @@ -829,7 +828,7 @@ print_path (const char *mypath) void -set_all_thresholds (struct parameter_list *path) +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); @@ -893,7 +892,7 @@ INPUT ERROR: C_DF (%lu) should be less than W_DF (%lu) and both should be greate void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); @@ -931,7 +930,7 @@ print_help (void) printf (" %s\n", "-e, --errors-only"); printf (" %s\n", _("Display only devices/mountpoints with errors")); printf (" %s\n", "-g, --group=NAME"); - printf (" %s\n", _("Group pathes. Thresholds apply to (free-)space of all partitions together")); + 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"); @@ -944,7 +943,7 @@ print_help (void) printf (" %s\n", "-m, --megabytes"); printf (" %s\n", _("Same as '--units MB'")); printf (" %s\n", "-A, --all"); - printf (" %s\n", _("Explicitly select all pathes. This is equivalent to -R '.*'")); + 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"); @@ -994,10 +993,10 @@ void stat_path (struct parameter_list *p) { /* Stat entry to check that dir exists and is accessible */ - if (verbose > 3) + if (verbose >= 3) printf("calling stat on %s\n", p->name); if (stat (p->name, &stat_buf[0])) { - if (verbose > 3) + if (verbose >= 3) printf("stat failed on %s\n", p->name); printf("DISK %s - ", _("CRITICAL")); die (STATE_CRITICAL, _("%s %s: %s\n"), p->name, _("is not accessible"), strerror(errno)); diff --git a/plugins/check_dns.c b/plugins/check_dns.c index b4240a2..873dcae 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 2000-2008 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-13 10:14:45 +0100 (Tue, 13 May 2008) $ -* * Description: * * This file contains the check_dns plugin @@ -28,12 +26,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_dns.c 1992 2008-05-13 09:14:45Z dermoth $ * *****************************************************************************/ const char *progname = "check_dns"; -const char *revision = "$Revision: 1992 $"; const char *copyright = "2000-2008"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -123,7 +119,7 @@ main (int argc, char **argv) /* scan stdout */ for(i = 0; i < chld_out.lines; i++) { - if (addresses == NULL) + if (addresses == NULL) addresses = malloc(sizeof(*addresses)*10); else if (!(n_addresses % 10)) addresses = realloc(addresses,sizeof(*addresses) * (n_addresses + 10)); @@ -255,7 +251,7 @@ main (int argc, char **argv) printf (_("DNS CRITICAL - %s\n"), !strcmp (msg, "") ? _(" Probably a non-existent host/domain") : msg); else - printf (_("DNS UNKNOW - %s\n"), + printf (_("DNS UNKNOWN - %s\n"), !strcmp (msg, "") ? _(" Probably a non-existent host/domain") : msg); return result; @@ -289,7 +285,7 @@ error_scan (char *input_buffer) 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) */ + /* 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); @@ -340,8 +336,8 @@ process_arguments (int argc, char **argv) {"reverse-server", required_argument, 0, 'r'}, {"expected-address", required_argument, 0, 'a'}, {"expect-authority", no_argument, 0, 'A'}, - {"warning", no_argument, 0, 'w'}, - {"critical", no_argument, 0, 'c'}, + {"warning", required_argument, 0, 'w'}, + {"critical", required_argument, 0, 'c'}, {0, 0, 0, 0} }; @@ -363,7 +359,7 @@ process_arguments (int argc, char **argv) print_help (); exit (STATE_OK); case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'v': /* version */ verbose = TRUE; @@ -446,7 +442,7 @@ validate_arguments () void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); diff --git a/plugins/check_dummy.c b/plugins/check_dummy.c index 1973f3f..8c3f535 100644 --- a/plugins/check_dummy.c +++ b/plugins/check_dummy.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 1999-2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-04-27 15:35:26 +0100 (Sun, 27 Apr 2008) $ -* * Description: * * This file contains the check_dummy plugin @@ -27,12 +25,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_dummy.c 1984 2008-04-27 14:35:26Z dermoth $ * *****************************************************************************/ const char *progname = "check_dummy"; -const char *revision = "$Revision: 1984 $"; const char *copyright = "1999-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -55,7 +51,7 @@ main (int argc, char **argv) if (argc < 2) usage4 (_("Could not parse arguments")); else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); } else if (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0) { @@ -87,7 +83,7 @@ main (int argc, char **argv) return STATE_UNKNOWN; } - if (argc >= 3) + if (argc >= 3) printf (": %s", argv[2]); printf("\n"); @@ -100,7 +96,7 @@ main (int argc, char **argv) void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); diff --git a/plugins/check_fping.c b/plugins/check_fping.c index f033e6c..b27389d 100644 --- a/plugins/check_fping.c +++ b/plugins/check_fping.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 2000-2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_disk plugin @@ -28,12 +26,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_fping.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ const char *progname = "check_fping"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "2000-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -58,6 +54,8 @@ void print_usage (void); char *server_name = 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; @@ -77,6 +75,7 @@ main (int argc, char **argv) char *server = NULL; char *command_line = NULL; char *input_buffer = NULL; + char *option_string = ""; input_buffer = malloc (MAX_INPUT_BUFFER); setlocale (LC_ALL, ""); @@ -92,8 +91,13 @@ main (int argc, char **argv) server = strscpy (server, server_name); /* compose the command */ - asprintf (&command_line, "%s -b %d -c %d %s", PATH_TO_FPING, - packet_size, packet_count, server); + if (target_timeout) + asprintf(&option_string, "%s-t %d ", option_string, target_timeout); + if (packet_interval) + asprintf(&option_string, "%s-p %d ", option_string, packet_interval); + + asprintf (&command_line, "%s %s-b %d -c %d %s", PATH_TO_FPING, + option_string, packet_size, packet_count, server); if (verbose) printf ("%s\n", command_line); @@ -232,6 +236,8 @@ process_arguments (int argc, char **argv) {"warning", required_argument, 0, 'w'}, {"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'}, @@ -252,7 +258,7 @@ process_arguments (int argc, char **argv) } while (1) { - c = getopt_long (argc, argv, "+hVvH:c:w:b:n:", longopts, &option); + c = getopt_long (argc, argv, "+hVvH:c:w:b:n:T:i:", longopts, &option); if (c == -1 || c == EOF || c == 1) break; @@ -264,7 +270,7 @@ process_arguments (int argc, char **argv) print_help (); exit (STATE_OK); case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'v': /* verbose mode */ verbose = TRUE; @@ -313,6 +319,18 @@ process_arguments (int argc, char **argv) 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; } } @@ -368,7 +386,7 @@ void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Didi Rieder \n"); printf (COPYRIGHT, copyright, email); @@ -391,9 +409,13 @@ print_help (void) printf (" %s\n", "-c, --critical=THRESHOLD"); printf (" %s\n", _("critical threshold pair")); printf (" %s\n", "-b, --bytes=INTEGER"); - printf (" %s\n", _("size of ICMP packet (default: %d)"),PACKET_SIZE); + printf (" %s (default: %d)\n", _("size of ICMP packet"),PACKET_SIZE); printf (" %s\n", "-n, --number=INTEGER"); - printf (" %s\n", _("number of ICMP packets to send (default: %d)"),PACKET_COUNT); + 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)"),PACKET_COUNT); + printf (" %s\n", "-i, --interval=INTEGER"); + printf (" %s (default: fping's default for -p)\n", _("Interval (ms) between sending packets"),PACKET_COUNT); printf (_(UT_VERBOSE)); printf ("\n"); printf (" %s\n", _("THRESHOLD is ,%% where is the round trip average travel time (ms)")); @@ -414,5 +436,5 @@ void print_usage (void) { printf (_("Usage:")); - printf (" %s -w limit -c limit [-b size] [-n number]\n", progname); + printf (" %s -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 index 7e884bc..235be65 100644 --- a/plugins/check_game.c +++ b/plugins/check_game.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 2002-2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_game plugin @@ -28,12 +26,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_game.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ const char *progname = "check_game"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "2002-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -105,7 +101,7 @@ main (int argc, char **argv) /* 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 + 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 @@ -139,10 +135,10 @@ main (int argc, char **argv) result = STATE_CRITICAL; } else { - printf ("OK: %s/%s %s (%s), Ping: %s ms|%s %s\n", + 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_game_field], ret[qstat_map_field], ret[qstat_ping_field], perfdata ("players", atol(ret[qstat_game_players]), "", @@ -202,7 +198,7 @@ process_arguments (int argc, char **argv) print_help (); exit (STATE_OK); case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'v': /* version */ verbose = TRUE; @@ -293,7 +289,7 @@ validate_arguments (void) void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Ian Cass, Knowledge Matters Limited\n"); printf (COPYRIGHT, copyright, email); @@ -345,7 +341,7 @@ print_usage (void) * 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 * diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c index 7a6bf3e..add9cc8 100644 --- a/plugins/check_hpjd.c +++ b/plugins/check_hpjd.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 2000-2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_hpjd plugin @@ -28,12 +26,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_hpjd.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ const char *progname = "check_hpjd"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "2000-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -123,7 +119,7 @@ main (int argc, char **argv) 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 %s", PATH_TO_SNMPGET, community, + sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET, community, address, query_string); /* run the command */ @@ -198,7 +194,7 @@ main (int argc, char **argv) strcpy (display_message, temp_buffer + 1); break; default: /* fold multiline message */ - strncat (display_message, input_buffer, + strncat (display_message, input_buffer, sizeof (display_message) - strlen (display_message) - 1); } @@ -218,7 +214,7 @@ main (int argc, char **argv) sprintf (errmsg, "%s", input_buffer ); } - + /* close stderr */ (void) fclose (child_stderr); @@ -232,7 +228,7 @@ main (int argc, char **argv) /* might not be the problem, but most likely is. */ result = STATE_UNKNOWN ; asprintf (&errmsg, "%s : Timeout from host %s\n", errmsg, address ); - + } /* if we had no read errors, check the printer status results... */ @@ -326,7 +322,7 @@ process_arguments (int argc, char **argv) if (argc < 2) return ERROR; - + while (1) { c = getopt_long (argc, argv, "+hVH:C:", longopts, &option); @@ -346,7 +342,7 @@ process_arguments (int argc, char **argv) community = strscpy (community, optarg); break; case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'h': /* help */ print_help (); @@ -365,7 +361,7 @@ process_arguments (int argc, char **argv) usage2 (_("Invalid hostname/address"), argv[c]); } } - + if (community == NULL) { if (argv[c] != NULL ) community = argv[c]; @@ -387,7 +383,7 @@ validate_arguments (void) void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); diff --git a/plugins/check_http.c b/plugins/check_http.c index d740750..79f6adf 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 1999-2008 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_http plugin @@ -30,14 +28,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_http.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ /* splint -I. -I../../plugins -I../../lib/ -I/usr/kerberos/include/ ../../plugins/check_http.c */ const char *progname = "check_http"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "1999-2008"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -48,6 +44,9 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include #define INPUT_DELIMITER ";" +#define STICKY_NONE 0 +#define STICKY_HOST 1 +#define STICKY_PORT 2 #define HTTP_EXPECT "HTTP/1." enum { @@ -110,6 +109,7 @@ int display_html = FALSE; char **http_opt_headers; int http_opt_headers_count = 0; int onredirect = STATE_OK; +int followsticky = STICKY_NONE; int use_ssl = FALSE; int verbose = FALSE; int sd; @@ -137,24 +137,24 @@ main (int argc, char **argv) { int result = STATE_UNKNOWN; - setlocale (LC_ALL, ""); - bindtextdomain (PACKAGE, LOCALEDIR); - textdomain (PACKAGE); + 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); - asprintf (&user_agent, "User-Agent: check_http/%s (nagios-plugins %s)", - clean_revstring (revision), VERSION); + asprintf (&user_agent, "User-Agent: check_http/v%s (nagios-plugins %s)", + NP_VERSION, VERSION); - /* Parse extra opts if any */ - argv=np_extra_opts (&argc, argv, progname); + /* Parse extra opts if any */ + argv=np_extra_opts (&argc, argv, progname); if (process_arguments (argc, argv) == ERROR) usage4 (_("Could not parse arguments")); if (display_html == TRUE) - printf ("", + printf ("", use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url); @@ -187,6 +187,7 @@ process_arguments (int argc, char **argv) {"nohtml", no_argument, 0, 'n'}, {"ssl", no_argument, 0, 'S'}, {"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'}, @@ -228,7 +229,7 @@ process_arguments (int argc, char **argv) } while (1) { - c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:T:I:a:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option); + c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option); if (c == -1 || c == EOF) break; @@ -241,7 +242,7 @@ process_arguments (int argc, char **argv) exit (STATE_OK); break; case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); break; case 't': /* timeout period */ @@ -302,18 +303,23 @@ process_arguments (int argc, char **argv) server_port = HTTPS_PORT; break; case 'f': /* onredirect */ - if (!strcmp (optarg, "follow")) - onredirect = STATE_DEPENDENT; - if (!strcmp (optarg, "unknown")) + 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; - if (!strcmp (optarg, "ok")) + else if (!strcmp (optarg, "ok")) onredirect = STATE_OK; - if (!strcmp (optarg, "warning")) + else if (!strcmp (optarg, "warning")) onredirect = STATE_WARNING; - if (!strcmp (optarg, "critical")) + else if (!strcmp (optarg, "critical")) onredirect = STATE_CRITICAL; + else usage2 (_("Invalid onredirect option"), optarg); if (verbose) - printf(_("option f:%d \n"), onredirect); + 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) */ @@ -344,10 +350,16 @@ process_arguments (int argc, char **argv) strncpy (user_auth, optarg, MAX_INPUT_BUFFER - 1); user_auth[MAX_INPUT_BUFFER - 1] = 0; break; - case 'P': /* HTTP POST data in URL encoded format */ - if (http_method || http_post_data) break; - http_method = strdup("POST"); - http_post_data = strdup (optarg); + 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 's': /* string or substring */ strncpy (string_expect, optarg, MAX_INPUT_BUFFER - 1); @@ -410,7 +422,7 @@ process_arguments (int argc, char **argv) exit (STATE_WARNING); } else max_page_len = atoi(tmp); - } else + } else min_page_len = atoi (optarg); break; } @@ -549,7 +561,7 @@ parse_time_string (const char *string) 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, @@ -573,14 +585,33 @@ parse_time_string (const char *string) } } +/* 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")); -static void -check_document_dates (const char *headers) + 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) { @@ -598,7 +629,10 @@ check_document_dates (const char *headers) /* Skip to the end of the header, including continuation lines. */ while (*s && !(*s == '\n' && (s[1] != ' ' && s[1] != '\t'))) s++; - s++; + + /* Avoid stepping over end-of-string marker */ + if (*s) + s++; /* Process this header. */ if (value && value > field+2) { @@ -631,34 +665,38 @@ check_document_dates (const char *headers) /* Done parsing the body. Now check the dates we (hopefully) parsed. */ if (!server_date || !*server_date) { - die (STATE_UNKNOWN, _("HTTP UNKNOWN - Server date unknown\n")); + asprintf (msg, _("%sServer date unknown, "), *msg); + date_result = max_state_alt(STATE_UNKNOWN, date_result); } else if (!document_date || !*document_date) { - die (STATE_CRITICAL, _("HTTP CRITICAL - Document modification date unknown\n")); + asprintf (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) { - die (STATE_CRITICAL, _("HTTP CRITICAL - Server date \"%100s\" unparsable"), server_date); + asprintf (msg, _("%sServer date \"%100s\" unparsable, "), *msg, server_date); + date_result = max_state_alt(STATE_CRITICAL, date_result); } else if (doc_data <= 0) { - die (STATE_CRITICAL, _("HTTP CRITICAL - Document date \"%100s\" unparsable"), document_date); + asprintf (msg, _("%sDocument date \"%100s\" unparsable, "), *msg, document_date); + date_result = max_state_alt(STATE_CRITICAL, date_result); } else if (doc_data > srv_data + 30) { - die (STATE_CRITICAL, _("HTTP CRITICAL - Document is %d seconds in the future\n"), (int)doc_data - (int)srv_data); + asprintf (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)) - die (STATE_CRITICAL, - _("HTTP CRITICAL - Last modified %.1f days ago\n"), - ((float) n) / (60 * 60 * 24)); - else - die (STATE_CRITICAL, - _("HTTP CRITICAL - Last modified %d:%02d:%02d ago\n"), - n / (60 * 60), (n / 60) % 60, n % 60); + int n = (srv_data - doc_data); + if (n > (60 * 60 * 24 * 2)) { + asprintf (msg, _("%sLast modified %.1f days ago, "), *msg, ((float) n) / (60 * 60 * 24)); + date_result = max_state_alt(STATE_CRITICAL, date_result); + } else { + asprintf (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 @@ -711,6 +749,22 @@ get_content_length (const char *headers) 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) { @@ -729,31 +783,41 @@ check_http (void) long microsec; double elapsed_time; int page_len = 0; - int result = STATE_UNKNOWN; + int result = STATE_OK; /* 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, _("HTTP CRITICAL - Unable to open TCP socket\n")); #ifdef HAVE_SSL if (use_ssl == TRUE) { - np_net_ssl_init(sd); + np_net_ssl_init_with_hostname(sd, host_name); if (check_cert == TRUE) { result = np_net_ssl_check_cert(days_till_exp); np_net_ssl_cleanup(); - if(sd) close(sd); + if (sd) close(sd); return result; } } #endif /* HAVE_SSL */ - asprintf (&buf, "%s %s HTTP/1.0\r\n%s\r\n", http_method, server_url, user_agent); + 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 */ asprintf (&buf, "%sConnection: close\r\n", buf); /* optionally send the host header info */ - if (host_name) - asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port); + if (host_name) { + /* + * 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 && server_port == HTTP_PORT) || + (use_ssl == TRUE && server_port == HTTPS_PORT)) + asprintf (&buf, "%sHost: %s\r\n", buf, host_name); + else + asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port); + } /* optionally send any other header tag */ if (http_opt_headers_count) { @@ -761,7 +825,9 @@ check_http (void) for ((pos = strtok(http_opt_headers[i], INPUT_DELIMITER)); pos; (pos = strtok(NULL, INPUT_DELIMITER))) asprintf (&buf, "%s%s\r\n", buf, pos); } - free(http_opt_headers); + /* 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 */ @@ -770,7 +836,7 @@ check_http (void) asprintf (&buf, "%sAuthorization: Basic %s\r\n", buf, auth); } - /* either send http POST data */ + /* either send http POST data (any data, not only POST)*/ if (http_post_data) { if (http_content_type) { asprintf (&buf, "%sContent-Type: %s\r\n", buf, http_content_type); @@ -832,10 +898,11 @@ check_http (void) #ifdef HAVE_SSL np_net_ssl_cleanup(); #endif - if(sd) close(sd); + if (sd) close(sd); - /* reset the alarm */ - alarm (0); + /* 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; @@ -873,22 +940,23 @@ check_http (void) (no_body ? " [[ skipped ]]" : page)); /* make sure the status line matches the response we are looking for */ - if (!strstr (status_line, server_expect)) { + if (!expected_statuscode (status_line, server_expect)) { if (server_port == HTTP_PORT) asprintf (&msg, - _("Invalid HTTP response received from host\n")); + _("Invalid HTTP response received from host: %s\n"), + status_line); else asprintf (&msg, - _("Invalid HTTP response received from host on port %d\n"), - server_port); + _("Invalid HTTP response received from host on port %d: %s\n"), + server_port, status_line); die (STATE_CRITICAL, "HTTP CRITICAL - %s", msg); } - /* Exit here if server_expect was set by user and not default */ + /* 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 ) { asprintf (&msg, - _("HTTP OK: Status line output matched \"%s\"\n"), - server_expect); + _("Status line output matched \"%s\" - "), server_expect); if (verbose) printf ("%s\n",msg); } @@ -905,123 +973,110 @@ check_http (void) /* check the return code */ - if (http_status >= 600 || http_status < 100) + 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) - die (STATE_CRITICAL, _("HTTP CRITICAL: %s\n"), status_line); - + else if (http_status >= 500) { + asprintf (&msg, _("%s - "), status_line); + result = STATE_CRITICAL; + } /* client errors result in a warning state */ - else if (http_status >= 400) - die (STATE_WARNING, _("HTTP WARNING: %s\n"), status_line); - + else if (http_status >= 400) { + asprintf (&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 if (onredirect == STATE_UNKNOWN) - printf (_("HTTP UNKNOWN")); - else if (onredirect == STATE_OK) - printf (_("HTTP OK")); - else if (onredirect == STATE_WARNING) - printf (_("HTTP WARNING")); - else if (onredirect == STATE_CRITICAL) - printf (_("HTTP CRITICAL")); - microsec = deltime (tv); - elapsed_time = (double)microsec / 1.0e6; - die (onredirect, - _(" - %s - %.3f second response time %s|%s %s\n"), - status_line, elapsed_time, - (display_html ? "" : ""), - perfd_time (elapsed_time), perfd_size (pagesize)); + else + result = max_state_alt(onredirect, result); + asprintf (&msg, _("%s - "), status_line); } /* end if (http_status >= 300) */ + else { + /* Print OK status anyway */ + asprintf (&msg, _("%s - "), status_line); + } } /* end else (server_expect_yn) */ - if (maximum_age >= 0) { - check_document_dates (header); - } + /* reset the alarm - must be called *after* redir or we'll never die on redirects! */ + alarm (0); - /* check elapsed time */ - microsec = deltime (tv); - elapsed_time = (double)microsec / 1.0e6; - asprintf (&msg, - _(" - %s - %.3f second response time %s|%s %s\n"), - status_line, elapsed_time, - (display_html ? "" : ""), - perfd_time (elapsed_time), perfd_size (pagesize)); - if (check_critical_time == TRUE && elapsed_time > critical_time) - die (STATE_CRITICAL, "HTTP %s: %s", _("CRITICAL"), msg); - if (check_warning_time == TRUE && elapsed_time > warning_time) - die (STATE_WARNING, "HTTP %s: %s", _("WARNING"), msg); + if (maximum_age >= 0) { + result = max_state_alt(check_document_dates(header, &msg), result); + } /* Page and Header content checks go here */ - /* these checks should be last */ if (strlen (string_expect)) { - if (strstr (page, string_expect)) { - printf (_("HTTP OK %s - %.3f second response time %s|%s %s\n"), - status_line, elapsed_time, - (display_html ? "" : ""), - perfd_time (elapsed_time), perfd_size (pagesize)); - exit (STATE_OK); - } - else { - printf (_("HTTP CRITICAL - string not found%s|%s %s\n"), - (display_html ? "" : ""), - perfd_time (elapsed_time), perfd_size (pagesize)); - exit (STATE_CRITICAL); + if (!strstr (page, string_expect)) { + asprintf (&msg, _("%sstring not found, "), msg); + result = STATE_CRITICAL; } } if (strlen (regexp)) { errcode = regexec (&preg, page, REGS, pmatch, 0); if ((errcode == 0 && invert_regex == 0) || (errcode == REG_NOMATCH && invert_regex == 1)) { - printf (_("HTTP OK %s - %.3f second response time %s|%s %s\n"), - status_line, elapsed_time, - (display_html ? "" : ""), - perfd_time (elapsed_time), perfd_size (pagesize)); - exit (STATE_OK); + /* 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) - msg = strdup(_("pattern not found")); - else - msg = strdup(_("pattern found")); - printf (("%s - %s%s|%s %s\n"), - _("HTTP CRITICAL"), - msg, - (display_html ? "" : ""), - perfd_time (elapsed_time), perfd_size (pagesize)); - exit (STATE_CRITICAL); + if (invert_regex == 0) + asprintf (&msg, _("%spattern not found, "), msg); + else + asprintf (&msg, _("%spattern found, "), msg); + result = STATE_CRITICAL; } else { + /* FIXME: Shouldn't that be UNKNOWN? */ regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER); - printf (_("HTTP CRITICAL - Execute Error: %s\n"), errbuf); - exit (STATE_CRITICAL); + asprintf (&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)) { - printf (_("HTTP WARNING: page size %d too large%s|%s\n"), - page_len, (display_html ? "" : ""), perfd_size (page_len) ); - exit (STATE_WARNING); + asprintf (&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)) { - printf (_("HTTP WARNING: page size %d too small%s|%s\n"), - page_len, (display_html ? "" : ""), perfd_size (page_len) ); - exit (STATE_WARNING); + asprintf (&msg, _("%spage size %d too small, "), msg, page_len); + result = max_state_alt(STATE_WARNING, result); } - /* We only get here if all tests have been passed */ - asprintf (&msg, _("HTTP OK %s - %d bytes in %.3f seconds %s|%s %s\n"), - status_line, page_len, elapsed_time, + + /* Cut-off trailing characters */ + if(msg[strlen(msg)-2] == ',') + msg[strlen(msg)-2] = '\0'; + else + msg[strlen(msg)-3] = '\0'; + + /* check elapsed time */ + asprintf (&msg, + _("%s - %d bytes in %.3f second response time %s|%s %s"), + msg, page_len, elapsed_time, (display_html ? "" : ""), perfd_time (elapsed_time), perfd_size (page_len)); - die (STATE_OK, "%s", msg); + + if (check_critical_time == TRUE && elapsed_time > critical_time) + result = STATE_CRITICAL; + if (check_warning_time == TRUE && elapsed_time > warning_time) + result = max_state_alt(STATE_WARNING, result); + + die (result, "HTTP %s: %s\n", state_text(result), msg); + /* die failed? */ return STATE_UNKNOWN; } @@ -1054,14 +1109,14 @@ redir (char *pos, char *status_line) url = malloc (strcspn (pos, "\r\n")); if (url == NULL) - die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not allocate url\n")); + 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) + if (strlen(pos) == 0) die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not find redirect location - %s%s\n"), status_line, (display_html ? "" : "")); @@ -1085,26 +1140,29 @@ redir (char *pos, char *status_line) url = realloc (url, strcspn (pos, "\r\n") + 1); if (url == NULL) - die (STATE_UNKNOWN, _("HTTP UNKNOWN - could not allocate url\n")); + 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) + 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 ) { + 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) { + 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) { + else if (sscanf (pos, HD4, type, addr) == 2) { strcpy (url, HTTP_URL); use_ssl = server_type_check (type); i = server_port_check (use_ssl); @@ -1121,7 +1179,7 @@ redir (char *pos, char *status_line) i = server_port; strcpy (type, server_type); strcpy (addr, host_name ? host_name : server_address); - } + } else { die (STATE_UNKNOWN, @@ -1151,18 +1209,18 @@ redir (char *pos, char *status_line) free (host_name); host_name = strdup (addr); - free (server_address); - server_address = strdup (addr); + if (!(followsticky & STICKY_HOST)) { + free (server_address); + server_address = strdup (addr); + } + if (!(followsticky & STICKY_PORT)) { + server_port = i; + } free (server_url); - if ((url[0] == '/')) - server_url = strdup (url); - else if (asprintf(&server_url, "/%s", url) == -1) - die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not allocate server_url%s\n"), - display_html ? "" : ""); - free(url); + server_url = url; - if ((server_port = i) > MAX_PORT) + 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, @@ -1176,7 +1234,6 @@ redir (char *pos, char *status_line) } - int server_type_check (const char *type) { @@ -1216,7 +1273,7 @@ char *perfd_size (int page_len) void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); @@ -1243,7 +1300,7 @@ print_help (void) 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 (" %s", _("Port number (default: ")); printf ("%d)\n", HTTP_PORT); printf (_(UT_IPv46)); @@ -1253,11 +1310,12 @@ print_help (void) printf (" %s\n", _("Connect via SSL. Port defaults to 443")); printf (" %s\n", "-C, --certificate=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.)\n")); + printf (" %s\n", _("(when this option is used the URL is not checked.)\n")); #endif printf (" %s\n", "-e, --expect=STRING"); - printf (" %s\n", _("String to expect in first (status) line of server response (default: ")); + 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", "-s, --string=STRING"); @@ -1266,6 +1324,8 @@ print_help (void) 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)"); + 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.)")); @@ -1292,8 +1352,9 @@ print_help (void) printf (" %s\n", _(" Any other tags to be sent in http header. Use multiple times for additional headers")); printf (" %s\n", "-L, --link"); printf (" %s\n", _("Wrap output in HTML link (obsoleted by urlize)")); - printf (" %s\n", "-f, --onredirect="); - printf (" %s\n", _("How to handle redirected pages")); + printf (" %s\n", "-f, --onredirect="); + printf (" %s\n", _("How to handle redirected pages. sticky is like follow but stick to the")); + printf (" %s\n", _("specified IP address. stickyport also ensure post stays the same.")); printf (" %s\n", "-m, --pagesize=INTEGER<:INTEGER>"); printf (" %s\n", _("Minimum page size required (bytes) : Maximum page size required (bytes)")); @@ -1346,8 +1407,8 @@ print_usage (void) printf (_("Usage:")); printf (" %s -H | -I [-u ] [-p ]\n",progname); printf (" [-w ] [-c ] [-t ] [-L]\n"); - printf (" [-a auth] [-f ] [-e ]\n"); - printf (" [-s string] [-l] [-r | -R ] [-P string]\n"); - printf (" [-m :] [-4|-6] [-N] [-M ] [-A string]\n"); - printf (" [-k string] [-S] [-C ] [-T ]\n"); + printf (" [-a auth] [-f ]\n"); + printf (" [-e ] [-s string] [-l] [-r | -R ]\n"); + printf (" [-P string] [-m :] [-4|-6] [-N] [-M ]\n"); + printf (" [-A string] [-k string] [-S] [-C ] [-T ] [-j method]\n"); } diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c index 86cc6fa..b0b0189 100644 --- a/plugins/check_ide_smart.c +++ b/plugins/check_ide_smart.c @@ -9,8 +9,6 @@ * Copyright (c) 2000 Robert Dale * Copyright (c) 2000-2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_ide_smart plugin @@ -32,12 +30,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_ide_smart.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ const char *progname = "check_ide_smart"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "1998-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -173,7 +169,8 @@ main (int argc, char *argv[]) {"auto-off", no_argument, 0, '0'}, {"nagios", no_argument, 0, 'n'}, {"help", no_argument, 0, 'h'}, - {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} + {"version", no_argument, 0, 'V'}, + {0, 0, 0, 0} }; setlocale (LC_ALL, ""); @@ -210,7 +207,7 @@ main (int argc, char *argv[]) print_help (); return STATE_OK; case 'V': - print_revision (progname, revision); + print_revision (progname, NP_VERSION); return STATE_OK; default: usage5 (); @@ -480,7 +477,7 @@ smart_read_thresholds (int fd, thresholds_t * thresholds) void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Nagios feature - 1999 Robert Dale \n"); printf ("(C) 1999 Ragnar Hojland Espinosa \n"); diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index a15b818..25432de 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 2000-2008 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_ldap plugin @@ -25,13 +23,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_ldap.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ /* progname may be check_ldaps */ char *progname = "check_ldap"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "2000-2008"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -87,15 +83,15 @@ main (int argc, char *argv[]) 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 tls; + int version=3; setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); @@ -129,7 +125,7 @@ main (int argc, char *argv[]) printf ("Could not connect to the server at port %i\n", ld_port); return STATE_CRITICAL; } -#else +#else if (!(ld = ldap_open (ld_host, ld_port))) { if (verbose) ldap_perror(ld, "ldap_open"); @@ -137,7 +133,7 @@ main (int argc, char *argv[]) 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) != @@ -152,7 +148,7 @@ main (int argc, char *argv[]) #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) @@ -179,7 +175,7 @@ main (int argc, char *argv[]) /* call start_tls */ if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) { - if (verbose) + if (verbose) ldap_perror(ld, "ldap_start_tls"); printf (_("Could not init startTLS at port %i!\n"), ld_port); return STATE_CRITICAL; @@ -189,13 +185,13 @@ main (int argc, char *argv[]) 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")); + printf (_("Could not bind to the LDAP server\n")); return STATE_CRITICAL; } @@ -289,7 +285,7 @@ process_arguments (int argc, char **argv) print_help (); exit (STATE_OK); case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 't': /* timeout period */ if (!is_intnonneg (optarg)) @@ -390,7 +386,7 @@ print_help (void) char *myport; asprintf (&myport, "%d", DEFAULT_PORT); - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)\n"); printf (COPYRIGHT, copyright, email); diff --git a/plugins/check_load.c b/plugins/check_load.c index 42236d9..940d37e 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 1999-2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_load plugin @@ -27,12 +25,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_load.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ const char *progname = "check_load"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "1999-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -245,7 +241,7 @@ process_arguments (int argc, char **argv) take_into_account_cpus = 1; break; case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'h': /* help */ print_help (); @@ -298,7 +294,7 @@ validate_arguments (void) void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Felipe Gustavo de Almeida \n"); printf (COPYRIGHT, copyright, email); diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c index 9efa7ce..65260ed 100644 --- a/plugins/check_mrtg.c +++ b/plugins/check_mrtg.c @@ -5,8 +5,6 @@ * License: GPL * Copyright (c) 1999-2007 Nagios Plugins Development Team * -* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $ -* * Description: * * This file contains the check_mrtg plugin @@ -28,12 +26,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id: check_mrtg.c 1991 2008-05-07 10:02:42Z dermoth $ * *****************************************************************************/ const char *progname = "check_mrtg"; -const char *revision = "$Revision: 1991 $"; const char *copyright = "1999-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -57,7 +53,7 @@ char *units; int main (int argc, char **argv) { - int result = STATE_UNKNOWN; + int result = STATE_OK; FILE *fp; int line; char input_buffer[MAX_INPUT_BUFFER]; @@ -181,7 +177,7 @@ process_arguments (int argc, char **argv) {"warning", required_argument, 0, 'w'}, {"label", required_argument, 0, 'l'}, {"units", required_argument, 0, 'u'}, - {"verbose", no_argument, 0, 'v'}, + {"variable", required_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} @@ -237,7 +233,7 @@ process_arguments (int argc, char **argv) units = optarg; break; case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'h': /* help */ print_help (); @@ -317,7 +313,7 @@ validate_arguments (void) void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf ("Copyright (c) 1999 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); @@ -334,7 +330,7 @@ print_help (void) printf (" %s\n", "-F, --logfile=FILE"); printf (" %s\n", _("The MRTG log file containing the data you want to monitor")); - printf ("-e, --expires=MINUTES"); + 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?")); @@ -380,7 +376,7 @@ print_help (void) -/* original command line: +/* original command line: