adjtimex-1.29/0000755000175000017500000000000011362175762011450 5ustar jrvjrvadjtimex-1.29/config.h.in0000644000175000017500000000423711172431647013475 0ustar jrvjrv/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_RTC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mktime' function. */ #undef HAVE_MKTIME /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif adjtimex-1.29/adjtimex.80000644000175000017500000003501211156053713013337 0ustar jrvjrv.\"{{{ Title Emacs major mode should be: -*- nroff -*- .TH ADJTIMEX 8 "March 11, 2009" .\"}}} .\"{{{ Name .SH NAME adjtimex \- display or set the kernel time variables .\"}}} .\"{{{ Synopsis .SH SYNOPSIS .ad l .\" commands only \fBadjtimex\fP [\fIoption\fP]... .\"}}} .\"{{{ Config .SH DESCRIPTION This program gives you raw access to the kernel time variables. Anyone may print out the time variables, but only the superuser may change them. .PP Your computer has two clocks - the "hardware clock" that runs all the time, and the system clock that runs only while the computer is on. Normally, "hwclock --hctosys" should be run at startup to initialize the system clock. The system clock has much better precision (approximately 1 usec), but the hardware clock probably has better long-term stability. There are three basic strategies for managing these clocks. .PP For a machine connected to the Internet, or equipped with a precision oscillator or radio clock, the best way is to regulate the system clock with \fBntpd\fP(8). The kernel will automatically update the hardware clock every eleven minutes. .PP In addition, \fBhwclock\fP(8) can be used to approximately correct for a constant drift in the hardware clock. In this case, "hwclock \-\-adjust" is run occasionally. \fBhwclock\fP notes how long it has been since the last adjustment, and nudges the hardware clock forward or back by the appropriate amount. The user needs to set the time with "hwclock \-\-set" several times over the course of a few days so \fBhwclock\fP can estimate the drift rate. During that time, \fBntpd\fP should not be running, or else \fBhwclock\fP will conclude the hardware clock does not drift at all. After you have run "hwclock \-\-set" for the last time, it's okay to start \fBntpd\fP. Then, "hwclock \-\-systohc" should be run when the machine is shut down. (To see why, suppose the machine runs for a week with \fBntpd\fP, is shut down for a day, is restarted, and "hwclock \-\-adjust" is run by a startup script. It should only correct for one day's worth of drift. However, it has no way of knowing that \fBntpd\fP has been adjusting the hardware clock, so it bases its adjustment on the last time \fBhwclock\fP was run.) .PP For a standalone or intermittently connected machine, where it's not possible to run \fBntpd\fP, you may use \fBadjtimex\fP instead to correct the system clock for systematic drift. .PP There are several ways to estimate the drift rate. If your computer can be connected to the net, you might run \fBntpd\fP for at least several hours and run "adjtimex \-\-print" to learn what values of tick and freq it settled on. Alternately, you could estimate values using as a reference the CMOS clock (see the \fB\-\-compare\fP and \fB\-\-adjust\fP switches), another host (see \fB\-\-host\fP and \fB\-\-review\fP), or some other source of time (see \fB\-\-watch\fP and \fB\-\-review\fP). You could then add a line to \fIrc.local\fP invoking \fBadjtimex\fP, or configure \fI/etc/init.d/adjtimex\fP or \fI/etc/default/adjtimex\fP, to set those parameters each time you reboot. .\"}}} .\"{{{ Options .SH OPTIONS Options may be introduced by either \fB\-\fP or \fB\-\-\fP, and unique abbreviations may be used. .PP Here is a summary of the options, grouped by type. Explanations follow. .hy 0 .na .TP .B Get/Set Kernel Time Parameters .br \-p \-\-print \-t .RI \-\-tick " val" .RI \-f " newfreq" .RI \-\-frequency " newfreq" .RI \-o " val" .RI \-\-offset " val" .RI \-s " adjustment" .RI \-\-singleshot " adjustment" .RI \-S " status" .RI \-\-status " status" .RI \-m " val" .RI \-R .RI \-\-reset .RI \-\-maxerror " val" .RI \-e " val" .RI \-\-esterror " val" .RI \-T " val" .RI \-\-timeconstant " val" .RI \-a[ count ] .RI \-\-adjust[= count ] .TP .B Estimate Systematic Drifts .br .RI \-c[ count ] .RI \-\-compare[= count ] .RI \-i " tim" .RI \-\-interval " tim" .RI \-l " file" .RI \-\-logfile " file" .RI \-h " timeserver" .RI \-\-host " timeserver" \-w \-\-watch \-r[\fIfile\fP] \-\-review[=\fIfile\fP] \-u \-\-utc \-d \-\-directisa \-n \-\-nointerrupt .TP \fBInformative Output\fP \-\-help \-v \-\-version \-V \-\-verbose .br .IP "\fB\-p\fP, \fB\-\-print\fP" Print the current values of the kernel time variables. NOTE: The time is "raw", and may be off by up to one timer tick (10 msec). "status" gives the value of the \fBtime_status\fP variable in the kernel. For Linux 1.0 and 1.2 kernels, the value is as follows: .nf 0 clock is synchronized (so the kernel should periodically set the CMOS clock to match the system clock) 1 inserting a leap second at midnight 2 deleting a leap second at midnight 3 leap second in progress 4 leap second has occurred 5 clock not externally synchronized (so the kernel should leave the CMOS clock alone) .fi For Linux kernels 2.0 through 2.6, the value is a sum of these: .nf 1 PLL updates enabled 2 PPS freq discipline enabled 4 PPS time discipline enabled 8 frequency-lock mode enabled 16 inserting leap second 32 deleting leap second 64 clock unsynchronized 128 holding frequency 256 PPS signal present 512 PPS signal jitter exceeded 1024 PPS signal wander exceeded 2048 PPS signal calibration error 4096 clock hardware fault .fi .IP "\fB\-t\fP \fIval\fP, \fB\-\-tick\fP \fIval\fP" Set the number of microseconds that should be added to the system time for each kernel tick interrupt. For a kernel with USER_HZ=100, there are supposed to be 100 ticks per second, so \fIval\fP should be close to 10000. Increasing \fIval\fP by 1 speeds up the system clock by about 100 ppm, or 8.64 sec/day. \fItick\fP must be in the range 900000/USER_HZ...1100000/USER_HZ. If \fIval\fP is rejected by the kernel, \fBadjtimex\fP will determine the acceptable range through trial and error and print it. (After completing the search, it will restore the original value.) .IP "\fB\-f\fP \fInewfreq\fP, \fB\-\-frequency\fP \fInewfreq\fP" Set the system clock frequency offset to \fInewfreq\fP. \fInewfreq\fP can be negative or positive, and gives a much finer adjustment than the \fB\-\-tick\fP switch. When USER_HZ=100, the value is scaled such that \fInewfreq\fP = 65536 speeds up the system clock by about 1 ppm, or .0864 sec/day. Thus, all of these are about the same: .nf \fB\-\-tick 9995 \--frequency 32768000\fP \fB\-\-tick 10000 \--frequency 6553600\fP \fB\-\-tick 10001 \--frequency 0\fP \fB\-\-tick 10002 \--frequency -6553600\fP \fB\-\-tick 10005 \--frequency -32768000\fP .fi To see the acceptable range for \fInewfreq\fP, use \-\-print and look at "tolerance", or try an illegal value (e.g. \-\-tick 0). .IP "\fB\-s\fP \fIadj\fP, \fB\-\-singleshot\fP \fIadj\fP" Slew the system clock by \fIadj\fP usec. (Its rate is changed temporarily by about 1 part in 2000.) .IP "\fB\-o\fP \fIadj\fP, \fB\-\-offset\fP \fIadj\fP" Add a time offset of \fIadj\fP usec. The kernel code adjusts the time gradually by \fIadj\fP, notes how long it has been since the last time offset, and then adjusts the frequency offset to correct for the apparent drift. .\"The short range of this parameter makes it almost .\"totally useless except for use with ntpd: \fIadj\fP must be in the range -512000...512000. .IP "\fB\-S\fP \fIstatus\fP, \fB\-\-status\fP \fIstatus\fP" Set kernel system clock status register to value \fIstatus\fP. Look here above at the \fB\-\-print\fP switch section for the meaning of \fIstatus\fP, depending on your kernel. .IP "\fB\-R\fP, \fB\-\-reset\fP" Reset clock status after setting a clock parameter. For early Linux kernels, using the adjtimex(2) system call to set any time parameter the kernel think the clock is synchronized with an external time source, so it sets the kernel variable time_status to TIME_OK. Thereafter, at 11 minute intervals, it will adjust the CMOS clock to match. We prevent this "eleven minute mode" by setting the clock, because that has the side effect of resetting time_status to TIME_BAD. We try not to actually change the clock setting. Kernel versions 2.0.40 and later apparently don't need this. If your kernel does require it, use this option with: \fB\-t\fP \fB\-T\fP \fB\-t\fP \fB\-e\fP \fB\-m\fP \fB\-f\fP \fB\-s\fP \fB\-o\fP \fB\-c\fP \fB\-r\fP. .IP "\fB\-m\fP \fIval\fP, \fB\-\-maxerror\fP \fIval\fP" Set maximum error (usec). .IP "\fB\-e\fP \fIval\fP, \fB\-\-esterror\fP \fIval\fP" Set estimated error (usec). The maximum and estimated error are not used by the kernel. They are merely made available to user processes via the \fBadjtimex\fP(2) system call. .IP "\fB\-T\fP \fIval\fP, \fB\-\-timeconstant\fP \fIval\fP" Set phase locked loop (PLL) time constant. \fIval\fP determines the bandwidth or "stiffness" of the PLL. The effective PLL time constant will be a multiple of (2^\fIval\fP). For room\-temperature quartz oscillators, David Mills recommends the value 2, which corresponds to a PLL time constant of about 900 sec and a maximum update interval of about 64 sec. The maximum update interval scales directly with the time constant, so that at the maximum time constant of 6, the update interval can be as large as 1024 sec. Values of \fIval\fP between zero and 2 give quick convergence; values between 2 and 6 can be used to reduce network load, but at a modest cost in accuracy. .IP "\fB\-c\fP[\fIcount\fP], \fB\-\-compare\fP[\fB=\fP\fIcount\fP]" Periodically compare the system clock with the CMOS clock. After the first two calls, print values for tick and frequency offset that would bring the system clock into approximate agreement with the CMOS clock. CMOS clock readings are adjusted for systematic drift using using the correction in \fI/etc/adjtime\fP \(em see \fBhwclock\fP(8). The interval between comparisons is 10 seconds, unless changed by the \fB\-\-interval\fP switch. The optional argument is the number of comparisons. (If the argument is supplied, the "\fB=\fP" is required.) If the CMOS clock and the system clock differ by more than six minutes, \fBadjtimex\fP will try shifting the time from the CMOS clock by some multiple of one hour, up to plus or minus 13 hours in all. This should allow correct operation, including logging, if the \-\-utc switch was used when the CMOS clock is set to local time (or vice-versa), or if summer time has started or stopped since the CMOS clock was last set. .IP "\fB\-a\fP[\fP\fIcount\fP], \fB\-\-adjust\fP[\fB=\fP\fIcount\fP]" By itself, same as \fB\-\-compare\fP, except the recommended values are actually installed after every third comparison. With \fB\-\-review\fP, the tick and frequency are set to the least\-squares estimates. (In the latter case, any \fIcount\fP value is ignored.) .IP "\fB\-\-force\-adjust\fP" Override the sanity check that prevents changing the clock rate by more than 500 ppm. .IP "\fB\-i\fP \fItim\fP, \fB\-\-interval\fP \fItim\fP" Set the interval in seconds between clock comparisons for the \fB\-\-compare\fP and \fB\-\-adjust\fP options. .IP "\fB\-u\fP, \fB\-\-utc\fP" The CMOS clock is set to UTC (universal time) rather than local time. .IP "\fB\-d\fP, \fB\-\-directisa\fP" To read the CMOS clock accurately, \fBadjtimex\fP usually accesses the clock via the /dev/rtc device driver of the kernel, and makes use of its CMOS update-ended interrupt to detect the beginning of seconds. It will also try /dev/rtc0 (for udev), /dev/misc/rtc (for the obsolete devfs) and possibly others. When the /dev/rtc driver is absent, or when the interrupt is not available, \fBadjtimex\fP can sometimes automatically fallback to a direct access method. This method detects the start of seconds by polling the update\-in\-progress (UIP) flag of the CMOS clock. You can force this direct access to the CMOS chip with the \fB\-\-directisa\fP switch. Note that the /dev/rtc interrupt method is more accurate, less sensible to perturbations due to system load, cleaner, cheaper, and is generally better than the direct access method. It is advisable to not use the \fB\-\-directisa\fP switch, unless the CMOS chip or the motherboard don't properly provide the necessary interrupt. .IP "\fB\-n\fP, \fB\-\-nointerrupt\fP" Force immediate use of busywait access method, without first waiting for the interrupt timeout. .IP "\fB\-l\fP[\fIfile\fP], \fB\-\-log\fP[\fB=\fP\fIfile\fP]" Save the current values of the system and CMOS clocks, and optionally a reference time, to \fIfile\fP (default \fI/var/log/clocks.log\fP). The reference time is taken from a network timeserver (see the \fB\-\-host\fP switch) or supplied by the user (see the \fB\-\-watch\fP switch). .IP "\fB\-h\fP \fItimeserver\fP, \fB\-\-host\fP \fItimeserver\fP" Use \fBntpdate\fP to query the given timeserver for the current time. This will fail if \fItimeserver\fP is not running a Network Time Protocol (NTP) server, or if that server is not synchronized. Implies \fB\-\-log\fP. .IP "\fB\-w\fP, \fB\-\-watch\fP" Ask for a keypress when the user knows the time, then ask what that time was, and its approximate accuracy. Implies \fB\-\-log\fP. .IP "\fB\-r\fP[\fIfile\fP], \fB\-\-review\fP[\fB=\fP\fIfile\fP]" Review the clock log \fIfile\fP (default \fI/var/log/clocks.log\fP) and estimate, if possible, the rates of the CMOS and system clocks. Calculate least\-squares rates using all suitable log entries. Suggest corrections to adjust for systematic drift. With \fB\-\-adjust\fP, the frequency and tick are set to the suggested values. (The CMOS clock correction is not changed.) .IP "\fB\-V\fP, \fB\-\-verbose\fP" Increase verbosity. .IP "\fB\-\-help\fP" Print the program options. .IP "\fB\-v\fP, \fB\-\-version\fP" Print the program version. .PP .\"}}} .\"{{{ Examples .SH EXAMPLES If your system clock gained 8 seconds in 24 hours, you could set the tick to 9999, and then it would lose 0.64 seconds a day (that is, 1 tick unit = 8.64 seconds per day). To correct the rest of the error, you could set the frequency offset to (2^16)*0.64/.0864 = 485452. Thus, putting the following in rc.local would approximately correct the system clock: .nf adjtimex --tick 9999 --freq 485452 .fi .PP .\"}}} .\"{{{ Notes .SH NOTES \fBadjtimex\fP adjusts only the system clock \(em the one that runs while the computer is powered up. To set or regulate the CMOS clock, see \fBhwclock\fP(8). .\"}}} .\"{{{ Author .SH AUTHORS Steven S. Dick , Jim Van Zandt . .\"}}} .\"{{{ See also .SH "SEE ALSO" .BR date "(1L), " gettimeofday "(2), " settimeofday "(2), " .BR hwclock "(8), " ntpdate "(8), " ntpd "(8), " \fI/usr/src/linux/include/linux/timex.h, /usr/src/linux/include/linux/sched.h, /usr/src/linux/kernel/time.c, /usr/src/linux/kernel/sched.c\fP .\"}}} adjtimex-1.29/mat.h0000644000175000017500000000132606402303441012366 0ustar jrvjrvvoid mat_copy(void *, int, int, void *, int, int); void mat_add(void *, int, int, void *, int, int, void *, int, int); void mat_sub(void *, int, int, void *, int, int, void *, int, int); void mat_zero(void *, int, int); void mat_one(void *, int, int); void mat_mul(void *, int, int, void *, int, int, void *, int, int); void mat_mul_tn(void *, int, int, void *, int, int, void *, int, int); void mat_mul_nt(void *, int, int, void *, int, int, void *, int, int); int mat_similarity(void *, int, int, void *, int, int, void *, int, int); int sym_factor(void *, int, int, void *, int, int); void sym_rdiv(void *, int, int, void *, int, int, void *, int, int); void sym_ldiv(void *, int, int, void *, int, int, void *, int, int); adjtimex-1.29/README0000644000175000017500000001530710701743665012335 0ustar jrvjrvADJTIMEX I will assume you have already read the man page for adjtimex :-) BACKGROUND You probably already know that your computer has two clocks - the "real time clock" (RTC) that runs all the time, and the system clock that runs only while the computer is on. The system clock has much better precision (approximately 1 usec), but the RTC probably has better long-term stability. adjtimex can be used to approximately correct the system clock for drift. The handiest reference clock is the RTC. adjtimex --compare shows the time, the difference between the two clocks, the first difference (how much the system clock has gained or lost relative to the RTC since the last check), and two kernel time parameters: tick and frequency offset. After the first two comparisons, it also prints suggested values of tick and frequency offset that will adjust the system clock to approximately agree with the RTC. Of course, the RTC may have a systematic error of its own. clock(8) or hwclock(8) use the file /etc/adjtime to record the drift rate and the time since the RTC was last set. adjtimex also consults this file and applies the correction to the times from the RTC. adjtimex can also record the times on both clocks, and optionally another reference time, in a log. It can later compare the logged time and estimate drift rates. INSTALLATION Type "./configure" to configure, "make" to compile, then "make install" to copy the binary to /usr/local/bin, and the man page to /usr/local/man/man8. If you want the program installed in /usr rather than /usr/local, start with "./configure --prefix=/usr". ASIDES You will have to log in as root for most of the following. The standard kernel will leave the RTC alone only until one of the time parameters is set (using adjtimex, for example). Then it thinks ntpd is regulating the system time, and it starts "correcting" the RTC approximately every eleven minutes. adjtimex prevents this by setting the time after setting any parameter. It does not actually change the time. USAGE The file /etc/adjtime is used to correct for systematic error in the RTC. Set it up as explained in the man page for hwclock(8). Otherwise, without /etc/adjtime, adjtimex assumes that the RTC is already perfect. The latest version of hwclock(8) from Bryan Henderson can be found at . An older version is included (along with a lot of other useful utilities) in the util-linux collection. I'll explain the manual procedure first. Compile and run adjtimex with the --compare switch. Suppose the result is: # adjtimex --compare 794625929 -0.597638 -0.597638 ... 794625939 -0.602050 -0.004412 ... ^^^^^^^^^ This number says the system clock lost over 4 msec in just 10 sec with respect to the RTC, or 4 parts in 10000. Therefore, we increase the tick parameter to 10004, and repeat the comparison: # adjtimex --tick 10004 # adjtimex --compare 794626037 -0.644860 -0.644860 ... 794626047 -0.645259 -0.000399 ... Now the system clock is slow by about 39.9 parts per million. We can change the frequency offset to fix this. Recall that the frequency offset is in parts per million, with the fraction point in the center (16 bits on either side). Therefore, we set the offset to 39.9*65536 = 2614886: # adjtimex --frequency 2614886 # adjtimex --compare 794626313 -0.652147 -0.652147 ... 794626323 -0.652247 -0.000100 ... It still seems to be off by about 10 ppm, so we increase the offset by 10*65536, to 3270246: # adjtimex --frequency 3270246 # adjtimex --compare 794627233 -0.795221 -0.795221 ... 794627243 -0.795231 -0.000009 ... The entries in the "suggested" columns are calculated in this way. Using the --adjust switch automates the process - periodically installing the "suggested" values. By the way, using the --offset or --singleshot options seems to have a long-term effect on the clock. I suggest you determine the tick and frequency settings before trying the other options. You may already have an entry like this in /etc/rc.d/rc.S, /etc/init.d/boot, or one of the other startup files: # Adjust CMOS clock based on /etc/adjtime, then set system clock. # Add -u switch if your system keeps GMT. if [ -x /sbin/clock ]; then /sbin/clock -a fi Just add an entry like this: # Regulate the sytem clock if [ -x /sbin/adjtimex ]; then /sbin/adjtimex --tick 10004 --frequency 3270246 fi LONG TERM COMPARISONS You can use adjtimex to record the values of the CMOS and system times, and optionally a reference time, so drift rates can be determined over long periods. To enter a reference time manually, use # adjtimex --log --watch adjtimex will ask you to hit a key when you know the time, then will ask the time and its approximate precision. It will then ask whether either clock has been disturbed since the previous log entry. You can take the time from an accurate clock, a radio time broadcast like WWV or CHU, etc. If you have ntpdate installed (part of the xntp package), and your computer has network connectivity, use # adjtimex --log --host www.xxx.yyy.zzz and adjtimex will use ntpdate to request the time from the specified host. (Ask your Internet Service Provider whether he has an NTP time server, or can suggest one.) After you have made several log entries, you can ask adjtimex to review the log with # adjtimex --review It will take each pair of log entries in turn, and calculate the error in each clock's rate in parts per million (ppm), with its estimated uncertainty. It will also find over-all average errors, and will suggest parameter values to correct for drift. Be sure to check the outputs for consistency. One incorrect reference time can throw off all the calculations. FURTHER READING For authoritative documentation on the kernel time software, see the following, all by David L. Mills : [MIL92a] Mills, D.L. Network Time Protocol (Version 3) specification, implementation and analysis, RFC 1305, University of Delaware, March 1992, 113 pp. [MIL92c] Mills, D.L. Simple Network Time Protocol (SNTP), RFC 1361, University of Delaware, August 1992, 10 pp. [MIL94a] Mills, D.L. A kernel model for precision timekeeping. ARPA Network Working Group Report RFC-1589, University of Delaware, March 1994. 31 pp. README.kern, which can be found in louie.udel.edu:/pub/ntp/kernel.tar.Z. THANKS to David Mills for the kernel timekeeping code, and Steven Dick for writing adjtimex originally. (I've changed the code a lot. Any problems are my responsibility.) Thanks also to Michael Meskes , whose Debian installation script inspired the "--compare" and "--adjust" options. Enjoy! - Jim Van Zandt adjtimex-1.29/install-sh0000755000175000017500000001124506353525324013454 0ustar jrvjrv#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 adjtimex-1.29/configure0000755000175000017500000044143711172435163013365 0ustar jrvjrv#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="adjtimex.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS EGREP GREP CPP LN_S INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi 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 $as_me, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 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 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else 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 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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_prog_cc_g=yes else $as_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 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC 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 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&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 #include 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/time.h unistd.h linux/rtc.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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_c_const=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const /**/ _ACEOF fi { $as_echo "$as_me:$LINENO: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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_c_inline=$ac_kw else $as_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 test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then $as_echo_n "(cached) " >&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 int main () { if ((struct tm *) 0) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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_header_time=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then $as_echo_n "(cached) " >&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 int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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_struct_tm=time.h else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi for ac_func in gettimeofday mktime putenv select do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_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 rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi adjtimex-1.29/adjtimex.lsm.in0000644000175000017500000000172111050151022014351 0ustar jrvjrvBegin4 Title: adjtimex - display or set the kernel time variables Version: @VERSION@ Entered-date: @DATE@ Description: Display or set the kernel time variables. This program gives you raw access to the kernel time variables. For a machine connected to the Internet, or equipped with a precision oscillator or radio clock, the best way to keep the system clock correct is with ntpd. However, for a standalone or intermittently connected machine, you may use adjtimex instead to at least correct for systematic drift. adjtimex can optionally adjust the system clock using the CMOS clock as a reference, and can log times for long-term estimation of drift rates. Keywords: time, system clock, hardware clock Author: ssd@nevets.oau.org (Steven S. Dick) Maintained-by: jrvz@removeme.comcast.net (Jim Van Zandt) Primary-site: metalab.unc.edu /pub/Linux/system/admin/time 59k adjtimex-@VERSION@.tar.gz Alternate-site: Original-site: Platforms: Linux Copying-policy: GPL End adjtimex-1.29/COPYING0000644000175000017500000004307606516736677012532 0ustar jrvjrv GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. adjtimex-1.29/COPYRIGHT0000644000175000017500000000137406516736677012765 0ustar jrvjrv adjtimex is Copyright (C) 1997 Steven S. Dick and James R. Van Zandt 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; version 2 dated June, 1991, or 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. adjtimex-1.29/README.ru0000644000175000017500000001574510033612653012756 0ustar jrvjrvADJTIMEX ñ ÂÕÄÕ ÓÞÉÔÁÔØ, ÞÔÏ ×Ù ÕÖÅ ÐÒÏÞÉÔÁÌÉ ÓÔÒÁÎÉÞËÕ man ÐÏ adjtimex :-) ÷÷åäåîéå ÷ÏÚÍÏÖÎÏ, ×Ù ÕÖÅ ÚÎÁÅÔÅ, ÞÔÏ × ×ÁÛÅÍ ËÏÍÐØÀÔÅÒÅ ÉÍÅÀÔÓÑ Ä×ÏÅ ÞÁÓÏ× - "ÞÁÓÙ ÒÅÁÌØÎÏÇÏ ×ÒÅÍÅÎÉ" (RTC - Real Time Clock), ËÏÔÏÒÙÅ ÉÄÕÔ ×ÓÅ ×ÒÅÍÑ, É ÓÉÓÔÅÍÎÙÅ ÞÁÓÙ, ËÏÔÏÒÙÅ ÉÄÕÔ ÔÏÌØËÏ ÐÒÉ ×ËÌÀÞÅÎÎÏÍ ËÏÍÐØÀÔÅÒÅ. ôÏÞÎÏÓÔØ ×ÙÛÅ Õ ÓÉÓÔÅÍÎÙÈ ÞÁÓÏ× (ÐÒÉÍÅÒÎÏ 1 uÓÅË), ÎÏ Õ RTC, ×ÏÚÍÏÖÎÏ, ÌÕÞÛÅ ÓÔÁÂÉÌØÎÏÓÔØ ÎÁ ÄÌÉÔÅÌØÎÏÍ ÐÒÏÍÅÖÕÔËÅ (long-term stability). adjtimex ÐÒÅÄÎÁÚÎÁÞÅÎ ÄÌÑ ÐÒÉÂÌÉÚÉÔÅÌØÎÏÊ ËÏÒÒÅËÃÉÉ ÕÈÏÄÁ ÓÉÓÔÅÍÎÙÈ ÞÁÓÏ×. RTC Ñ×ÌÑÀÔÓÑ ÕÄÏÂÎÙÍÉ ÏÐÏÒÎÙÍÉ ÞÁÓÁÍÉ adjtimex --compare ÐÏËÁÚÙ×ÁÅÔ ×ÒÅÍÑ, ÒÁÚÎÉÃÕ ÍÅÖÄÕ Ä×ÕÍÑ ÞÁÓÁÍÉ, ÐÅÒ×ÏÅ ÒÁÚÌÉÞÉÅ (ËÁË ÓÉÌØÎÏ ÓÐÅÛÁÔ ÉÌÉ ÏÔÓÔÁÀÔ ÓÉÓÔÅÍÎÙÅ ÞÁÓÙ ÐÏ ÓÒÁ×ÎÅÎÉÀ Ó ÐÏÓÌÅÄÎÅÊ Ó×ÅÒËÏÊ Ó RTC), É Ä×Á ×ÒÅÍÅÎÎÙÈ ÐÁÒÁÍÅÔÒÁ ÑÄÒÁ: tick É ÓÄ×ÉÇ ÞÁÓÔÏÔÙ. ðÏÓÌÅ ÐÅÒ×ÙÈ Ä×ÕÈ ÓÒÁ×ÎÅÎÉÊ ÏÎ ÔÁËÖÅ ×Ù×ÏÄÉÔ ÒÅËÏÍÅÎÄÕÅÍÙÅ ÚÎÁÞÅÎÉÑ ÔÉËÏ× É ÓÄ×ÉÇÁ ÞÁÓÔÏÔÙ, ËÏÔÏÒÙÅ ÐÏÄÒÅÇÕÌÉÒÕÀÔ ÓÉÓÔÅÍÎÙÅ ÞÁÓÙ Ó ÐÒÉÂÌÉÚÉÔÅÌØÎÙÍ ÚÎÁÞÅÎÉÅÍ RTC. ëÏÎÅÞÎÏ, RTC ÍÏÇÕÔ ÉÍÅÀÔ ÓÏÂÓÔ×ÅÎÎÕÀ ÓÉÓÔÅÍÁÔÉÞÅÓËÕÀ ÏÛÉÂËÕ. clock(8) ÉÌÉ hwclock(8) ÉÓÐÏÌØÚÕÀÔ ÆÁÊÌ /etc/adjtime ÄÌÑ ÚÁÐÉÓÉ ËÏÜÆÆÉÃÉÅÎÔÁ ÕÈÏÄÁ (drift rate) É ×ÒÅÍÅÎÉ ÐÏÓÌÅ ÐÏÓÌÅÄÎÅÊ ÕÓÔÁÎÏ×ËÉ RTC. adjtimex ÔÁËÖÅ Ó×ÅÒÑÅÔÓÑ Ó ÜÔÉÍ ÆÁÊÌÏÍ É ÉÓÐÏÌØÚÕÅÔ ËÏÒÒÅËÃÉÀ ËÏ ×ÒÅÍÅÎÉ RTC. ëÒÏÍÅ ÔÏÇÏ, adjtimex ÍÏÖÅÔ ÚÁÐÉÓÙ×ÁÔØ ×ÒÅÍÑ ÏÂÏÉÈ ÞÁÓÏ× É ÄÏÐÏÌÎÉÔÅÌØÎÏÅ ÏÐÏÒÎÏÅ (reference) ×ÒÅÍÑ, × ÌÏÇ. úÁÔÅÍ ÜÔÏ ÓÒÁ×ÎÉ×ÁÅÔÓÑ Ó ÚÁÐÉÓÁÎÎÙÍ ×ÒÅÍÅÎÅÍ É ÒÁÓÓÞÉÔÙ×ÁÀÔÓÑ ×ÅÌÉÞÉÎÙ ÕÈÏÄÁ (drift rates). õóôáîï÷ëá äÌÑ ËÏÎÆÉÇÕÒÉÒÏ×ÁÎÉÑ ÎÁÂÅÒÉÔÅ "./configure", ÄÌÑ ËÏÍÐÉÌÑÃÉÉ - "make", ÚÁÔÅÍ "make install" ÄÌÑ ËÏÐÉÒÏ×ÁÎÉÑ ÂÉÎÁÒÎÉËÁ × /usr/local/bin, Á ÓÔÒÁÎÉÃÙ man × /usr/local/man/man8. åÓÌÉ ×Ù ÈÏÔÉÔÅ ÕÓÔÁÎÏ×ÉÔØ ÐÒÏÇÒÁÍÍÕ × /usr ×ÍÅÓÔÏ /usr/local, ÎÁÞÎÉÔÅ Ó "./configure --prefix=/usr". ëòïíå ôïçï äÌÑ ×ÙÐÏÌÎÅÎÉÑ ÂÏÌØÛÉÎÓÔ×Á ÎÉÖÅÓÌÅÄÕÀÝÉÈ ÄÅÊÓÔ×ÉÊ ×Ù ÄÏÌÖÎÙ ×ÏÊÔÉ ËÁË root. óÔÁÎÄÁÒÔÎÏÅ ÑÄÒÏ ÎÅ ÂÕÄÅÔ ÔÒÏÇÁÔØ RTC, ÐÏËÁ ÎÅ ÂÕÄÅÔ ÕÓÔÁÎÁ×ÌÉ×ÁÔØÓÑ ÏÄÉÎ ÉÚ ×ÒÅÍÅÎÎÙÈ ÐÁÒÁÍÅÔÒÏ× (ÎÁÐÒÉÍÅÒ, Ó ÐÏÍÏÝØÀ adjtimex). úÁÔÅÍ, ÐÒÅÄÐÏÌÁÇÁÑ, ÞÔÏ ntpd ÒÅÇÕÌÉÒÕÅÔ ÓÉÓÔÅÍÎÏÅ ×ÒÅÍÑ, ÚÁÐÕÓËÁÅÔ "ËÏÒÒÅËÃÉÀ" RTC ÐÒÉÍÅÒÎÏ ËÁÖÄÙÅ ÏÄÉÎÎÁÄÃÁÔØ ÍÉÎÕÔ. adjtimex ÐÒÅÄÏÔ×ÒÁÝÁÅÔ ÜÔÏ ÕÓÔÁÎÏ×ËÏÊ ×ÒÅÍÅÎÉ ÐÏÓÌÅ ÉÚÍÅÎÅÎÉÑ ÌÀÂÏÇÏ ÐÁÒÁÍÅÔÒÁ. ÷ ÄÅÊÓÔ×ÉÔÅÌØÎÏÓÔÉ ×ÒÅÍÑ ÎÅ ÉÚÍÅÎÉÔÓÑ. éóðïìøúï÷áîéå óÏÚÄÁÊÔÅ /etc/adjtime, ËÏÔÏÒÙÊ ÉÓÐÏÌØÚÕÅÔÓÑ clock(8) É hwclock(8) ÄÌÑ ËÏÒÒÅËÃÉÉ ÓÉÓÔÅÍÁÔÉÞÅÓËÏÊ ÏÛÉÂËÉ × RTC. õÓÔÁÎÏ×ÉÔÅ ÅÇÏ, ËÁË ÏÐÉÓÁÎÏ × ÓÔÒÁÎÉÃÅ man, ÄÌÑ ËÁÖÄÏÊ ÐÒÏÇÒÁÍÍÙ. clock ×ËÌÀÞÁÅÔÓÑ (×ÍÅÓÔÅ Ó ÍÎÏÖÅÓÔ×ÏÍ ÄÒÕÇÉÈ ÐÏÌÅÚÎÙÈ ÕÔÉÌÉÔ) × ËÏÌÌÅËÃÉÀ òÉËÁ æÜÊÔÁ (Rik Faith): sunsite.unc.edu:pub/Linux/system/Misc/util-linux-1.10.tar.gz åÓÌÉ ×ÁÛ RTC ÕÖÅ ÄÏÓÔÁÔÏÞÎÏ ÔÏÞÅÎ ÄÌÑ ×ÁÓ, ÐÒÏÓÔÏ ÓÏÚÄÁÊÔÅ ÆÁÊÌ /etc/adjtime, ÓÏÄÅÒÖÁÝÉÊ ÔÏÌØËÏ ÏÄÎÕ ÐÅÒ×ÕÀ ÓÔÒÏÞËÕ: '0.0 0 0.0'. óÎÁÞÁÌÁ Ñ ÏÂßÑÓÎÀ ÒÕÞÎÕÀ ÐÒÏÃÅÄÕÒÕ. óËÏÍÐÉÌÉÒÕÊÔÅ É ÚÁÐÕÓÔÉÔÅ adjtimex Ó ËÌÀÞÏÍ --compare. ïÖÉÄÁÅÍÙÅ ÒÅÚÕÌØÔÁÔÙ ÐÒÉÍÅÒÎÏ ÔÁËÉÅ: # adjtimex --compare 794625929 -0.597638 -0.597638 ... 794625939 -0.602050 -0.004412 ... ^^^^^^^^^ üÔÏ ÞÉÓÌÏ ÓÏÏÂÝÁÅÔ, ÞÔÏ ÓÉÓÔÅÍÎÙÅ ÞÁÓÙ ÏÔÓÔÁÀÔ ÂÏÌÅÅ ÞÅÍ ÎÁ 4 ÍÉÌÌÉÓÅËÕÎÄÙ ÚÁ 10 ÓÅËÕÎÄ ÐÏ ÓÒÁ×ÎÅÎÉÀ Ó RTC, ÉÌÉ 4 ÞÁÓÔÉ ÎÁ 10000. óÌÅÄÏ×ÁÔÅÌØÎÏ, ÍÙ Õ×ÅÌÉÞÉ×ÁÅÍ ÐÁÒÁÍÅÔÒ tick ÄÏ 10004 É ÐÏ×ÔÏÒÑÅÍ ÓÒÁ×ÎÅÎÉÅ: # adjtimex --tick 10004 # adjtimex --compare 794626037 -0.644860 -0.644860 ... 794626047 -0.645259 -0.000399 ... ôÅÐÅÒØ ÓÉÓÔÅÍÎÙÅ ÞÁÓÙ ÏÔÓÔÁÀÔ ÐÒÉÍÅÒÎÏ ÎÁ 39.9 ÞÁÓÔÅÊ ÎÁ ÍÉÌÌÉÏÎ. äÌÑ ËÏÒÒÅËÃÉÉ ÜÔÏÇÏ ÍÙ ÍÏÖÅÍ ÉÚÍÅÎÉÔØ ÓÄ×ÉÇ ÞÁÓÔÏÔÙ (frequency offset). ÷ÓÐÏÍÎÉÔÅ, ÞÔÏ ÓÄ×ÉÇ ÞÁÓÔÏÔÙ - ÜÔÏ × ÞÁÓÔÑÈ ÎÁ ÍÉÌÌÉÏÎ, Ó ÔÏÞËÏÊ ÄÅÌÅÎÉÑ × ÃÅÎÔÒÅ (ÐÏ 16 ÂÉÔ Ó ËÁÖÄÏÊ ÓÔÏÒÏÎÙ). óÌÅÄÏ×ÁÔÅÌØÎÏ, ÍÙ ÕÓÔÁÎÁ×ÌÉ×ÁÅÍ ÓÄ×ÉÇ × 39.9*65536 = 2614886: # adjtimex --frequency 2614886 # adjtimex --compare 794626313 -0.652147 -0.652147 ... 794626323 -0.652247 -0.000100 ... ÷ÉÄÎÏ, ÞÔÏ ÅÓÔØ ÅÝÅ ÒÁÚÎÉÃÁ ÏËÏÌÏ 10 ppm, ÐÏÜÔÏÍÕ ÍÙ Õ×ÅÌÉÞÉÍ ÓÄ×ÉÇ ÎÁ 10*65536, ÄÏ 3270246: # adjtimex --frequency 3270246 # adjtimex --compare 794627233 -0.795221 -0.795221 ... 794627243 -0.795231 -0.000009 ... ôÁËÉÍ ÖÅ ÏÂÒÁÚÏÍ ×ÙÓÞÉÔÙ×ÁÀÔÓÑ ÚÎÁÞÅÎÉÑ × ËÏÌÏÎËÅ "suggested" ("òÅËÏÍÅÄÎÏ×ÁÎÏ"). ðÒÉÍÅÎÅÎÉÅ ËÌÀÞÁ --adjust Á×ÔÏÍÁÔÉÚÉÒÕÅÔ ÐÒÏÃÅÓÓ - ÐÅÒÉÏÄÉÞÅÓËÉ ÕÓÔÁÎÁ×ÌÉ×ÁÑ "ÒÅËÏÍÅÎÄÕÅÍÙÅ" ÚÎÁÞÅÎÉÑ. ëÓÔÁÔÉ, ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÏÐÃÉÊ --offset ÉÌÉ --singleshot ËÁÖÅÔÓÑ ÉÍÅÀÔ ÄÌÉÔÅÌØÎÏÅ ÄÅÊÓÔ×ÉÅ ÎÁ ÞÁÓÙ. ñ ÒÅËÏÍÅÎÄÕÀ ×ÁÍ ÏÐÒÅÄÅÌÉÔØ ÚÎÁÞÅÎÉÑ tick É ÞÁÓÔÏÔÙ ÄÏ ÐÒÉÍÅÎÅÎÉÑ ÄÒÕÇÉÈ ÏÐÃÉÊ. õ ×ÁÓ ÕÖÅ ÍÏÖÅÔ ÂÙÔØ ÚÁÐÉÓØ, ÐÏÄÏÂÎÁÑ ÜÔÏÊ, × /etc/rc.d/rc.S, /etc/init.d/boot ÉÌÉ ÏÄÎÏÍ ÉÚ ÄÒÕÇÉÈ ÓÔÁÒÔÏ×ÙÈ ÆÁÊÌÏ×: # Adjust CMOS clock based on /etc/adjtime, then set system clock. # Add -u switch if your system keeps GMT. if [ -x /sbin/clock ]; then /sbin/clock -a fi ðÒÏÓÔÏ ÄÏÂÁרÔÅ ÚÁÐÉÓØ ÔÉÐÁ ÜÔÏÊ: # Regulate the sytem clock if [ -x /sbin/adjtimex ]; then /sbin/adjtimex --tick 10004 --frequency 3270246 fi ðòïäïìöéôåìøîùå óòá÷îåîéñ adjtimex ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÄÌÑ ÚÁÐÉÓÉ ÚÎÁÞÅÎÉÊ ×ÒÅÍÅÎÉ CMOS É ÓÉÓÔÅÍÙ, É ÄÏÐÏÌÎÉÔÅÌØÎÏÇÏ ÏÐÏÒÎÏÇÏ (reference) ×ÒÅÍÅÎÉ, ÞÔÏÂÙ ÍÏÖÎÏ ÂÙÌÏ ÏÐÒÅÄÅÌÉÔØ ËÏÜÆÆÉÃÉÅÎÔ ÕÈÏÄÁ ÚÁ ÄÌÉÔÅÌØÎÙÅ ÐÅÒÉÏÄÙ. äÌÑ ÒÕÞÎÏÇÏ ××ÏÄÁ ÏÐÏÒÎÏÇÏ ×ÒÅÍÅÎÉ ÉÓÐÏÌØÚÕÊÔÅ # adjtimex --log --watch adjtimex ÐÏÐÒÏÓÉÔ ×ÁÓ ÎÁÖÁÔØ ËÌÁ×ÉÛÕ, ËÏÇÄÁ ×Ù ÚÎÁÅÔÅ ×ÒÅÍÑ, ÚÁÔÅÍ ÓÐÒÏÓÉÔ ×ÒÅÍÑ É ÐÒÉÂÌÉÚÉÔÅÌØÎÕÀ ÔÏÞÎÏÓÔØ. úÁÔÅÍ ÓÐÒÏÓÉÔ ÂÙÌ ÌÉ ÓÂÏÊ ËÁËÉÈ ÌÉÂÏ ÞÁÓÏ× Ó ÍÏÍÅÎÔÁ ÐÏÓÌÅÄÎÅÊ ÚÁÐÉÓÉ × ÌÏÇÅ. ÷ÒÅÍÑ ×Ù ÍÏÖÅÔÅ ×ÚÑÔØ Ó ÔÏÞÎÙÈ ÞÁÓÏ×, ÒÁÄÉÏÍÁÑËÁ ×ÒÅÍÅÎÉ ÔÉÐÁ WWV ÉÌÉ CHU É Ô.Ä. åÓÌÉ Õ ×ÁÓ ÕÓÔÁÎÏ×ÌÅÎ ntpdate (ÞÁÓÔØ ÐÁËÅÔÁ xntp) É ËÏÍÐØÀÔÅÒ ÐÏÄËÌÀÞÅÎ Ë ÓÅÔÉ, ÉÓÐÏÌØÚÕÊÔÅ # adjtimex --log --host www.xxx.yyy.zzz É adjtimex ÂÕÄÅÔ ÉÓÐÏÌØÚÏ×ÁÔØ ntpdate ÄÌÑ ÚÁÐÒÏÓÁ ×ÒÅÍÅÎÉ Ó ÕËÁÚÁÎÎÏÇÏ ÈÏÓÔÁ. (õÔÏÞÎÉÔÅ Õ Ó×ÏÅÇÏ ÐÒÏ×ÁÊÄÅÒÁ, ÉÍÅÅÔ ÌÉ ÏÎ ÓÅÒ×ÅÒ ×ÒÅÍÅÎÉ NTP, ÉÌÉ ËÁËÏÊ ÏÎ ÍÏÖÅÔ ÐÒÅÄÌÏÖÉÔØ.) ðÏÓÌÅ ÔÏÇÏ, ËÁË ×Ù ÓÄÅÌÁÅÔÅ ÎÅÓËÏÌØËÏ ÚÁÐÉÓÅÊ × log, ×Ù ÍÏÖÅÔÅ ÚÁÓÔÁ×ÉÔØ adjtimex ÐÒÏÓÍÏÔÒÅÔØ ÌÏÇ Ó ÐÏÍÏÝØÀ # adjtimex --review ïÎ ×ÏÚØÍÅÔ ËÁÖÄÕÀ ÐÁÒÕ ÚÁÐÉÓÅÊ ÌÏÇÁ × ÃÉËÌÅ É ×ÙÞÉÓÌÉÔ ÄÌÑ ÎÉÈ ËÏÜÆÆÉÃÉÅÎÔ ÏÛÉÂËÉ × ÞÁÓÔÑÈ ÎÁ ÍÉÌÌÉÏÎ (ppm) Ó ÚÁÄÁÎÎÏÊ ÔÏÞÎÏÓÔØÀ. ôÁËÖÅ ÂÕÄÕÔ ÎÁÊÄÅÎÙ ÕÓÒÅÄÎÅÎÎÙÅ ÏÛÉÂËÉ É ÐÒÅÄÌÏÖÅÎÙ ÚÎÁÞÅÎÉÑ ÐÁÒÁÍÅÔÒÏ× ÄÌÑ ËÏÒÒÅËÔÉÒÏ×ËÉ ÕÈÏÄÁ. ðÒÏ×ÅÒØÔÅ ÓÏÇÌÁÓÏ×ÁÎÎÏÓÔØ ÒÅÚÕÌØÔÁÔÁ. ïÄÎÁ ÎÅÐÒÁ×ÉÌØÎÁÑ ÚÁÐÉÓØ ÏÐÏÒÎÏÇÏ ×ÒÅÍÅÎÉ ÍÏÖÅÔ ÐÏÇÕÂÉÔØ ×ÓÅ ×ÙÞÉÓÌÅÎÉÑ. äáìøîåêûáñ éîæïòíáãéñ á×ÔÏÒÉÔÅÔÎÕÀ ÄÏËÕÍÅÎÔÁÃÉÀ ÐÏ ÐÒÏÇÒÁÍÍÅ ×ÒÅÍÅÎÉ ÑÄÒÁ ÓÍÏÔÒÉÔÅ ÓÄÅÓØ, ×ÓÅ ÎÁÐÉÓÁÎÏ David L. Mills : [MIL92a] Mills, D.L. Network Time Protocol (Version 3) specification, implementation and analysis, RFC 1305, University of Delaware, March 1992, 113 pp. [MIL92c] Mills, D.L. Simple Network Time Protocol (SNTP), RFC 1361, University of Delaware, August 1992, 10 pp. [MIL94a] Mills, D.L. A kernel model for precision timekeeping. ARPA Network Working Group Report RFC-1589, University of Delaware, March 1994. 31 pp. README.kern, ËÏÔÏÒÙÊ ÍÏÖÎÏ ÎÁÊÔÉ ÎÁ louie.udel.edu:/pub/ntp/kernel.tar.Z. âìáçïäáòîïóôé äÜ×ÉÄÕ íÉÌÌÓÕ (David Mills) ÚÁ ËÏÄ ÓÏÈÒÁÎÅÎÉÑ ×ÒÅÍÅÎÉ ÑÄÒÁ, É óÔÉ×ÅÎÕ äÉËÕ (Steven Dick) ÚÁ ÐÅÒ×ÏÎÁÞÁÌØÎÏÅ ÎÁÐÉÓÁÎÉÅ adjtimex. (ñ ÓÉÌØÎÏ ÉÚÍÅÎÉÌ ËÏÄ. ìÀÂÙÅ ÐÒÏÂÌÅÍÙ - ÍÏÑ ÏÔ×ÅÔÓÔ×ÅÎÎÏÓÔØ.) âÌÁÇÏÄÁÒÎÏÓÔØ ÔÁËÖÅ íÉËÁÜÌÀ íÅÓËÅÓÕ (Michael Meskes) , ÞÅÊ ÉÎÓÔÁÌÌÑÃÉÏÎÎÙÊ ÓËÒÉÐÔ × Debian ×ÄÏÈÎÏ×ÉÌ ÎÁ ÏÐÃÉÉ "--compare" É "--adjust". îÁÓÌÁÖÄÁÊÔÅÓØ! - Jim Van Zandt adjtimex-1.29/configure.in0000644000175000017500000000106311172402064013744 0ustar jrvjrvdnl Process this file with autoconf to produce a configure script. dnl Initialize. AC_PREREQ(2.60) AC_INIT(adjtimex.c) AC_CONFIG_HEADERS([config.h]) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(sys/time.h unistd.h linux/rtc.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_HEADER_TIME AC_STRUCT_TM dnl Checks for library functions. AC_CHECK_FUNCS(gettimeofday mktime putenv select) AC_OUTPUT(Makefile) adjtimex-1.29/adjtimex.lsm0000644000175000017500000000171311362175750013771 0ustar jrvjrvBegin4 Title: adjtimex - display or set the kernel time variables Version: 1.29 Entered-date: 2010-04-16 Description: Display or set the kernel time variables. This program gives you raw access to the kernel time variables. For a machine connected to the Internet, or equipped with a precision oscillator or radio clock, the best way to keep the system clock correct is with ntpd. However, for a standalone or intermittently connected machine, you may use adjtimex instead to at least correct for systematic drift. adjtimex can optionally adjust the system clock using the CMOS clock as a reference, and can log times for long-term estimation of drift rates. Keywords: time, system clock, hardware clock Author: ssd@nevets.oau.org (Steven S. Dick) Maintained-by: jrvz@removeme.comcast.net (Jim Van Zandt) Primary-site: metalab.unc.edu /pub/Linux/system/admin/time 59k adjtimex-1.29.tar.gz Alternate-site: Original-site: Platforms: Linux Copying-policy: GPL End adjtimex-1.29/Makefile.in0000644000175000017500000000365111362175577013526 0ustar jrvjrv#### Start of system configuration section. -*-makefile-*- #### srcdir = . VPATH = . VERSION=1.29 CFLAGS = @CFLAGS@ -Wall prefix = @prefix@ man1dir=@mandir@/man1 exec_prefix = @exec_prefix@ bindir=/sbin datadir = @datadir@ datarootdir = @datarootdir@ INSTALL=@INSTALL@ # Extension (not including `.') for the manual page filenames. manext = 8 # Where to put the manual pages. mandir = $(prefix)/share/man/man$(manext) #### End of system configuration section. #### SRC = adjtimex.c adjtimex.8 mat.c mat.h install-sh configure.in \ configure Makefile.in config.h.in README README.ru adjtimex.lsm \ adjtimex.lsm.in COPYING COPYRIGHT ChangeLog all: adjtimex adjtimex.lsm Makefile configure config.h.in: configure.in autoconf autoheader Makefile config.h: Makefile.in config.h.in ./configure adjtimex: adjtimex.c mat.o config.h Makefile $(CC) $(CFLAGS) -I. -DVERSION=\"$(VERSION)\" -o adjtimex \ adjtimex.c mat.o -lm mat.o: mat.c $(CC) $(CFLAGS) -c mat.c install: all $(INSTALL) -g bin -m 755 -o root adjtimex $(bindir)/adjtimex $(INSTALL) -d -g root -m 755 -o root $(mandir) -$(INSTALL) -g root -m 644 -o root $(srcdir)/adjtimex.8 \ $(mandir)/adjtimex.$(manext) uninstall: rm -f $(bindir)/adjtimex $(mandir)/adjtimex.$(manext) clean: rm -f core *.o veryclean: clean rm -f adjtimex adjtimex.lsm: adjtimex.lsm.in Makefile sed -e 's/@VERSION@/$(VERSION)/' \ -e "s/@DATE@/`date +%Y-%m-%d`/" \ adjtimex.lsm.in >adjtimex.lsm shar: $(SRC) distname=adjtimex-$(VERSION); \ shar $(SRC) >$$distname.shar dist: $(SRC) distname=adjtimex-$(VERSION); \ rm -fr $$distname; \ mkdir $$distname; \ for file in $(SRC); do \ ln $$file $$distname/$$file \ || { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \ done; \ chmod -R a+rX $$distname; \ tar -chz -f $$distname.tar.gz $$distname; \ rm -fr $$distname adjtimex-1.29/mat.c0000644000175000017500000001703406402303441012364 0ustar jrvjrv/* mat - manipulation of matrices c can equal: mat_zero 0 -> c mat_one I -> c mat_copy a -> c a mat_add a + b -> c a or b mat_sub a - b -> c a or b mat_mul a b -> c mat_mul_tn a' b -> c mat_mul_nt a b' -> c mat_similarity a b a' -> c b sym_factor lower triangular factor of a -> c a sym_rdiv (b already factored) a / b = a inv(b) -> c a sym_ldiv (a already factored) a \ b = inv(a) b -> c b Every matrix parameter is followed by two integers, which give the number of rows and the number of columns. The result is always returned in the last matrix. a' is the transpose of a. */ #include #include /* for sqrt() */ #include /* for malloc() and free() */ /* set c to zero */ void mat_zero(void *c, int cr, int cc) { double *_c = (double *)c; int i; for (i = 0; i < cr*cc; i++) _c[i] = 0.; } /* set c to the unit matrix */ void mat_one(void *_c, int cr, int cc) { double *c = (double *)_c; int i; assert(cr == cc); mat_zero(c, cr, cc); #define C(i,j) c[i*cc+j] for (i = 0; i < cr; i++) C(i,i) = 1.; #undef C } /* copy a to c */ void mat_copy(void *a, int ar, int ac, void *c, int cr, int cc) { double *_a = (double *)a; double *_c = (double *)c; int i; assert(ar == cr && ac == cc); for (i = 0; i < ar*ac; i++) _c[i] = _a[i]; } /* Add a and b, and put result in c. c may be the same as a and/or b. */ void mat_add(void *a, int ar, int ac, void *b, int br, int bc, void *c, int cr, int cc) { double *_a = (double *)a; double *_b = (double *)b; double *_c = (double *)c; int i; assert(ar == br && br == cr && ac == bc && bc == cc); for (i = 0; i < ar*ac; i++) _c[i] = _a[i] + _b[i]; } /* subtract b from a, and put result in c. c may be the same as a and/or b. */ void mat_sub(void *a, int ar, int ac, void *b, int br, int bc, void *c, int cr, int cc) { double *_a = (double *)a; double *_b = (double *)b; double *_c = (double *)c; int i; assert(ar == br && br == cr && ac == bc && bc == cc); for (i = 0; i < ar*ac; i++) _c[i] = _a[i] - _b[i]; } /* multiply a by b, put result in c */ void mat_mul(void *a, int ar, int ac, void *b, int br, int bc, void *c, int cr, int cc) { double *_a = (double *)a; double *_b = (double *)b; double *_c = (double *)c; double s; int i, j, k; #define A(i,j) _a[i*ac+j] #define B(i,j) _b[i*bc+j] #define C(i,j) _c[i*cc+j] assert(ar == cr && ac == br && bc == cc); for (i = 0; i < cr; i++) for (j = 0; j < cc; j++) { s = 0.; for (k = 0; k < ac; k++) s += A(i,k)*B(k,j); C(i,j) = s; } #undef A #undef B #undef C } /* multiply a' by b, put result in c */ void mat_mul_tn(void *a, int ar, int ac, void *b, int br, int bc, void *c, int cr, int cc) { double *_a = (double *)a; double *_b = (double *)b; double *_c = (double *)c; double s; int i, j, k; #define A(i,j) _a[i*ac+j] #define B(i,j) _b[i*bc+j] #define C(i,j) _c[i*cc+j] assert(ac == cr && ar == br && bc == cc); for (i = 0; i < cr; i++) for (j = 0; j < cc; j++) { s = 0.; for (k = 0; k < ar; k++) s += A(k,i)*B(k,j); C(i,j) = s; } #undef A #undef B #undef C } /* Multiply a by b', put result in c. */ void mat_mul_nt(void *a, int ar, int ac, void *b, int br, int bc, void *c, int cr, int cc) { double *_a = (double *)a; double *_b = (double *)b; double *_c = (double *)c; double s; int i, j, k; #define A(i,j) _a[i*ac+j] #define B(i,j) _b[i*bc+j] #define C(i,j) _c[i*cc+j] assert(ar == cr && ac == bc && br == cc); for (i = 0; i < cr; i++) for (j = 0; j < cc; j++) { s = 0.; for (k = 0; k < ac; k++) s += A(i,k)*B(j,k); C(i,j) = s; } #undef A #undef B #undef C } /* Form the product a*b*a', and leave the result in c. Return nonzero on failure (insufficient memory). */ int mat_similarity(void *a, int ar, int ac, void *b, int br, int bc, void *c, int cr, int cc) { void *t; assert(ac==br && br == bc && ar==cr && cr==cc); t = malloc(ar*bc*sizeof(double)); if (!t) return 1; /* failure */ mat_mul(a,ar,ac, b,br,bc, t,ar,bc); mat_mul_nt(t,ar,bc, a,ar,ac, c,cr,cc); free(t); return 0; } /* Perform Cholesky decomposition on the square, symmetric matrix a, and leave the lower triangular factor in c. The part of c above the diagonal is not disturbed. c may be the same as a. Returns nonzero if a is singular. Afterwards: if l is the lower triangular part of c, and l' is the transpose of l, then a = l l'. */ int sym_factor(void *a, int ar, int ac, void *c, int cr, int cc) { double *_a = (double *)a; double *_c = (double *)c; double d, s; int i, j, k; #define A(i,j) _a[i*ac+j] #define C(i,j) _c[i*cc+j] assert(ar == ac && ac == cr && cr == cc); /* must be square */ for (j = 0; j < cc; j++) /* columns of c */ { s = A(j,j); for (i = 0; i < j; i++) /* rows of c */ s -= C(j,i)*C(j,i); if (s < 0.) return 1; /* failure (singular matrix) */ d = C(j,j) = sqrt(s); for (i = j+1; i < cc; i++) /* columns of c */ { s = A(i,j); for (k = 0; k < j; k++) s -= C(j,k)*C(i,k); C(i,j) = s/d; } } return 0; #undef A #undef C } /* right divide a by b (that is, multiply a by inverse of b), and leave the result in c. b must already have been Cholesky decomposed, and only its lower triangle is used. c may be the same as a. */ void sym_rdiv(void *a, int ar, int ac, void *b, int br, int bc, void *c, int cr, int cc) { double *_a = (double *)a; double *_b = (double *)b; double *_c = (double *)c; double s; int i, j, k; #define A(i,j) _a[i*ac+j] #define B(i,j) _b[i*bc+j] #define C(i,j) _c[i*cc+j] assert(ar == cr && ac == cc && br == bc && ac == br); for (i = 0; i < ar; i++) /* rows of a */ { for (j = 0; j < ac; j++) /* cols of a */ { s = A(i,j); for (k = 0; k < j; k++) s -= C(i,k)*B(j,k); C(i,j) = s/B(j,j); } } for (i = 0; i < cr; i++) /* rows of c */ { for (j = cc; j--; ) /* cols of c */ { s = C(i,j); for (k = j+1; k < cc; k++) s -= C(i,k)*B(k,j); C(i,j) = s/B(j,j); } } #undef A #undef B #undef C } /* left divide b by a (that is, multiply inverse of a by b), and leave the result in c. a must already have been Cholesky decomposed, and only its lower triangle is used. c may be the same as b. */ void sym_ldiv(void *a, int ar, int ac, void *b, int br, int bc, void *c, int cr, int cc) { double *_a = (double *)a; double *_b = (double *)b; double *_c = (double *)c; double s; int i, j, k; #define A(i,j) _a[i*ac+j] #define B(i,j) _b[i*bc+j] #define C(i,j) _c[i*cc+j] assert(ar == cr && ac == br && ar == ac && bc == cc); for (j = 0; j < cc; j++) /* columns of c */ for (i = 0; i < cr; i++) /* rows of c */ { s = B(i,j); for (k = 0; k < i; k++) s -= A(i,k)*C(k,j); s = C(i,j) = s/A(i,i); } for (j = 0; j < cc; j++) /* columns of c */ for (i = cr; i--; ) /* rows of c */ { s = C(i,j); for (k = i+1; k < cr; k++) s -= A(k,i)*C(k,j); C(i,j) = s/A(i,i); } #undef A #undef B #undef C } adjtimex-1.29/adjtimex.c0000644000175000017500000017562011362175612013426 0ustar jrvjrv/* #define DEBUG adjtimex - display or set the kernel time variables AUTHORS ssd at nevets.oau.org (Steven S. Dick) jrvz at comcast.net (Jim Van Zandt) TODO: review code controlled by DEBUG and possibly change control to verbose flag. */ #define _GNU_SOURCE /* strptime is a GNU extension */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #ifdef HAVE_LINUX_RTC_H #include #else struct rtc_time { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; #define RTC_UIE_ON _IO('p', 0x03) /* Update int. enable on */ #define RTC_UIE_OFF _IO('p', 0x04) /* ... off */ #define RTC_PIE_OFF _IO('p', 0x06) /* Periodic int. enable off */ #define RTC_RD_TIME _IOR('p', 0x09, struct rtc_time) /* Read RTC time */ #endif /* HAVE_LINUX_RTC_H */ int F_print = 0; #ifndef LOG_PATH #define LOG_PATH "/var/log/clocks.log" #endif #ifndef WTMP_PATH #define WTMP_PATH "/var/log/wtmp" #endif /* Here the information for CMOS clock adjustments is kept. */ #define ADJPATH "/etc/adjtime" /* used for debugging the code. */ /* #define DEBUG */ #define RTC_JITTER .000025 /* assumed error in reading CMOS clock (sec) */ #define SECONDSPERDAY 86400 #define BUFLEN 128 #ifndef USE_INLINE_ASM_IO static int port_fd = -1; /* used to access the RTC via /dev/port I/O */ #endif static char *cmos_device; /* filename of the RTC device */ static int cmos_fd = -1; struct hack { double ref; /* reference time for time hack */ double sigma_ref; /* expected error in above (or zero if no reference time available) */ time_t log; /* reference time as time_t */ double sys; /* system time */ int tick; /* "tick" system parameter */ int freq; /* "freq" system parameter */ char sys_ok; /* nonzero if system clock undisturbed during previous period */ double cmos; /* CMOS time */ char cmos_ok; /* nonzero if cmos clock undisturbed during previous period */ char valid; /* bit flags (see below) */ double sys_rate, sys_sigma; double cmos_rate, cmos_sigma; double relative_rate, relative_sigma; } prev; /* constants for `valid' member of struct hack */ #define CMOS_VALID 1 #define SYS_VALID 2 #define REF_VALID 4 struct cmos_adj { double ca_factor; long ca_adj_time; double ca_remainder; } ca; struct timex txc; /* command line option variables */ static int using_dev_rtc = -1; /* 0 = not using /dev/rtc 1 = using /dev/rtc -1 = will use /dev/rtc if available, but have not tried to open it yet */ static int nointerrupt = 0; /* 0 = try to detect RTC tick via interrupt 1 = via another method */ int adjusting = 0; int force_adjust; int comparing = 0; int logging = 0; int reviewing = 0; int resetting = 0; /* nonzero if need to call reset_time_status() */ int interval = 10; int count = 8; int marked; int universal = 0; int verbose = 0; int watch; /* nonzero if time specified on command line */ int undisturbed_sys = 0; int undisturbed_cmos = 0; char *log_path = LOG_PATH; char *timeserver; /* points to name of timeserver */ enum {HELP=131}; struct option longopt[]= { {"adjust", 2, NULL, 'a'}, {"force-adjust", 0, &force_adjust, 1}, {"compare", 2, NULL, 'c'}, {"log", 2, NULL, 'l'}, {"esterror", 1, NULL, 'e'}, {"frequency", 1, NULL, 'f'}, {"host", 1, NULL, 'h'}, {"help", 0, NULL, HELP}, {"interval", 1, NULL, 'i'}, {"maxerror", 1, NULL, 'm'}, {"offset", 1, NULL, 'o'}, {"print", 0, NULL, 'p'}, {"review", 2, NULL, 'r'}, {"singleshot", 1, NULL, 's'}, {"status", 1, NULL, 'S'}, {"reset", 0, NULL, 'R'}, {"timeconstant", 1, NULL, 'T'}, {"tick", 1, NULL, 't'}, {"utc", 0, NULL, 'u'}, {"directisa", 0, NULL, 'd'}, {"nointerrupt", 0, NULL, 'n'}, {"version", 0, NULL, 'v'}, {"verbose", 0, NULL, 'V'}, {"watch", 0, NULL, 'w'}, {0,0,0,0} }; static void usage(void); static inline void outb (short port, char val); static inline void outb (short port, char val); static inline unsigned char inb (short port); static void cmos_init (); static void cmos_init_directisa (); static inline int cmos_read_bcd (int addr); static void cmos_read_time (time_t *cmos_timep, double *sysp); static void busywait_uip_fall(struct timeval *timestamp); static void busywait_second_change(struct tm *cmos, struct timeval *timestamp); static void compare(void); static void failntpdate(); static void reset_time_status(void); static struct cmos_adj *get_cmos_adjustment(void); static void log_times(void); static int valid_system_rate(double ftime_sys, double ftime_ref, double sigma_ref); static int valid_cmos_rate(double ftime_cmos, double ftime_ref, double sigma_ref); static void sethackent(void); static void endhackent(void); static struct hack *gethackent(void); static void puthackent(struct hack *ph); static time_t mkgmtime(struct tm *tp); static int compare_tm(struct tm *first, struct tm *second); static void *xmalloc(int n); static void *xrealloc(void *pv, int n); static void review(void); static void kalman_update(double *x, int xr, double *p, double *h, double *z, int zr, double *r); void usage(void) { char msg[]= "\n" "Usage: adjtimex [OPTION]... \n" "Mandatory or optional arguments to long options are mandatory or optional\n" "for short options too.\n" "\n" "Get/Set Kernel Time Parameters:\n" " -p, --print print values of kernel time variables\n" " -t, --tick val set the kernel tick interval in usec\n" " -f, --frequency newfreq set system clock frequency offset\n" " -s, --singleshot adj slew the system clock by adj usec\n" " -S, --status val set kernel clock status\n" " -R, --reset reset status after setting parameters\n" " (needed for early kernels)\n" " -o, --offset adj add a time offset of adj usec\n" " -m, --maxerror val set maximum error (usec)\n" " -e, --esterror val set estimated error (usec)\n" " -T, --timeconstant val set phase locked loop time constant\n" " -a, --adjust[=count] set system clock parameters per CMOS \n" " clock or (with --review) log file\n" " --force-adjust override +-1 percent sanity check\n" "\n" "Estimate Systematic Drifts:\n" " -c, --compare[=count] compare system and CMOS clocks\n" " -i, --interval tim set clock comparison interval (sec)\n" " -l, --log[=file] log current times to file\n" " -h, --host timeserver query the timeserver\n" " -w, --watch get current time from user\n" " -r, --review[=file] review clock log file, estimate drifts\n" " -u, --utc the CMOS clock is set to UTC\n" " -d, --directisa access the CMOS clock directly\n" " -n, --nointerrupt bypass the CMOS clock interrupt access method\n" "\n" "Informative Output:\n" " --help print this help, then exit\n" " -v, --version print adjtimex program version, then exit\n" " -V, --verbose increase verbosity\n" ; fputs(msg, stdout); exit(0); } /* return apparent value of USER_HZ in HZ, minimum nominal and maximum values for tick in TICK_MIN TICK_MID and TICK_MAX, and maximum frequency offset in MAXFREQ */ static void probe_time(int *hz, int *tick_min, int *tick_mid, int *tick_max, long *maxfreq) { struct timex txc; int tick_orig, tick_lo, tick_try, tick_hi, i; txc.modes = 0; adjtimex(&txc); /* fetch original value */ txc.modes = ADJ_TICK; if (adjtimex(&txc) == -1) /* try setting with no change */ { perror("adjtimex"); exit(1); } *maxfreq = txc.tolerance; tick_orig = tick_hi = txc.tick; tick_lo = tick_hi*2/3; for (i = 0; i < 15; i++) { /* conduct binary search for minimum accepted tick value */ // printf(" %d < minimum accepted tick value <= %d\n", tick_lo, tick_hi); txc.tick = tick_try = (tick_lo + tick_hi)/2; txc.modes = ADJ_TICK; if (adjtimex(&txc) == -1) tick_lo = tick_try; else tick_hi = tick_try; } *tick_min = tick_hi; tick_lo = tick_orig; tick_hi = tick_lo*4/3; for (i = 0; i < 15; i++) { /* conduct binary search for maximum accepted tick value */ // printf(" %d <= maximum accepted tick value < %d\n", tick_lo, tick_hi); txc.tick = tick_try = (tick_lo + tick_hi)/2; txc.modes = ADJ_TICK; if (adjtimex(&txc) == -1) tick_hi = tick_try; else tick_lo = tick_try; } *tick_max = tick_lo; *tick_mid = (*tick_min + *tick_max)/2; *hz = (900000/ *tick_min + 1100000/ *tick_max)/2; txc.tick = tick_orig; txc.modes = ADJ_TICK; adjtimex(&txc); /* reset to original value */ } int main(int argc, char *argv[]) { int ret, saveerr, changes; extern char *optarg; int c; txc.modes = 0; while((c = getopt_long_only(argc, argv, "a::c::l::e:f:h:i:m:o:pr::s:S:RT:t:udvVw", longopt, NULL)) != -1) { switch(c) { case 0: break; /* options that just set a variable are handled in longopt */ case 'a': adjusting = 1; if (optarg) count = atoi(optarg); break; case 'c': comparing = 1; if (optarg) count = atoi(optarg); break; case 'l': logging = 1; if (optarg) log_path = strdup(optarg); if (!log_path) { fprintf (stderr, "insufficient memory\n"); exit(1); } break; case 'h': timeserver = strdup(optarg); if (!timeserver) { fprintf (stderr, "insufficient memory\n"); exit(1); } logging = 1; break; case 'r': reviewing = 1; if (optarg) log_path = strdup(optarg); if (!log_path) { fprintf (stderr, "insufficient memory\n"); exit(1); } break; case 'i': interval = atoi (optarg); if (interval <= 1 || interval > 1000) { fprintf (stderr, "repeat interval out of range\n"); exit (1); } break; case 'p': F_print = 1; break; case 'o': txc.offset = atol(optarg); txc.modes |= ADJ_OFFSET; break; case 's': txc.offset = atol(optarg); txc.modes |= ADJ_OFFSET_SINGLESHOT; break; case 'S': txc.status = atol(optarg); txc.modes |= ADJ_STATUS; break; case 'R': resetting = 1; break; case 'f': txc.freq = atol(optarg); txc.modes |= ADJ_FREQUENCY; break; case 'm': txc.maxerror = atol(optarg); txc.modes |= ADJ_MAXERROR; break; case 'e': txc.esterror = atol(optarg); txc.modes |= ADJ_ESTERROR; break; case 'T': txc.constant = atol(optarg); txc.modes |= ADJ_TIMECONST; break; case 't': txc.tick = atol(optarg); txc.modes |= ADJ_TICK; break; case 'u': universal = 1; break; case 'd': using_dev_rtc = 0; break; case 'n': nointerrupt = 1; break; case 'v': { printf("adjtimex %s\n", VERSION); exit(0); } case 'V': verbose++; break; case 'w': watch = 1; logging = 1; break; case HELP: usage(); break; case '?': default: fprintf(stderr, "Unrecognized option %s\nFor valid " "options, try 'adjtimex --help'\n", argv[optind-1]); exit(1); } } changes = txc.modes; if (count <= 0 ) { fprintf(stderr, "loop count out of range\n"); exit(1); } if (reviewing) { review(); exit(0); } if (adjusting || comparing) { if (changes || F_print) { fprintf(stderr, "-adjust or -compare cannot be used with any other options that" " set values\n"); exit(1); } compare(); } if (logging) { /* if (geteuid() != 0) { fprintf(stderr, "sorry, only root can record clock comparisons\n"); exit(1); } */ log_times(); exit(0); } if ((txc.modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT && txc.modes != ADJ_OFFSET_SINGLESHOT) { fprintf(stderr, "-singleshot cannot be used with " "any other option except -print\n"); usage(); } errno = 0; ret = adjtimex(&txc); saveerr = errno; if (F_print) { printf(" mode: %d\n" " offset: %ld\n" " frequency: %ld\n" " maxerror: %ld\n" " esterror: %ld\n" " status: %d\n" "time_constant: %ld\n" " precision: %ld\n" " tolerance: %ld\n" " tick: %ld\n" " raw time: %ds %dus = %d.%06d\n", txc.modes, txc.offset, txc.freq, txc.maxerror, txc.esterror, txc.status, txc.constant, txc.precision, txc.tolerance, txc.tick, (int)txc.time.tv_sec, (int)txc.time.tv_usec, (int)txc.time.tv_sec, (int)txc.time.tv_usec); if (saveerr == 0 && ret != 0) printf(" return value = %d\n", ret); } if (ret != 0 && saveerr != 0) { if (ret != -1) fprintf(stderr, "%d ", ret); errno = saveerr; perror("adjtimex"); { int hz, tick_min, tick_mid, tick_max; long maxfreq; probe_time(&hz, &tick_min, &tick_mid, &tick_max, &maxfreq); printf("for this kernel:\n" " USER_HZ = %d (nominally %d ticks per second)\n" " %d <= tick <= %d\n" " %ld <= frequency <= %ld\n", hz, hz, tick_min, tick_max, -maxfreq, maxfreq); } exit(1); } if (changes && resetting) reset_time_status(); return 0; } static inline void outb (short port, char val) { #ifdef USE_INLINE_ASM_IO __asm__ volatile ("out%B0 %0,%1"::"a" (val), "d" (port)); #else lseek (port_fd, port, 0); write (port_fd, &val, 1); #endif } static inline unsigned char inb (short port) { unsigned char ret; #ifdef USE_INLINE_ASM_IO __asm__ volatile ("in%B0 %1,%0":"=a" (ret):"d" (port)); #else lseek (port_fd, port, 0); read (port_fd, &ret, 1); #endif return ret; } /* * Main initialisation of CMOS clock access methods, for all modes. * Set the global variable cmos_device to the first available RTC device * driver filename (/dev/rtc, /dev/rtc0, etc.), and set cmos_fd to * a file descriptor for it. * Failing that, select and initialize direct I/O ports mode. */ static void cmos_init () { /* following explanation taken from hwclock sources: /dev/rtc is conventionally chardev 10/135 ia64 uses /dev/efirtc, chardev 10/136 devfs (obsolete) used /dev/misc/... for miscdev new RTC framework + udev uses dynamic major and /dev/rtc0.../dev/rtcN */ char *fls[] = { #ifdef __ia64__ "/dev/efirtc", "/dev/misc/efirtc", #endif "/dev/rtc", "/dev/rtc0", "/dev/misc/rtc", NULL }; char **p=fls; if (using_dev_rtc < 0) { while ((cmos_device=*p++)) { cmos_fd = open (cmos_device, O_RDONLY); if (cmos_fd >= 0) { if (verbose) fprintf (stdout, "opened %s for reading\n", cmos_device); using_dev_rtc = 1; return; } if (verbose) { int saveerr=errno; fprintf (stdout, "adjtimex: cannot open %s for reading\n", cmos_device); errno = saveerr; perror("adjtimex"); } } using_dev_rtc = 0; } else if (using_dev_rtc > 0) return; /* otherwise do direct I/O */ cmos_init_directisa(); } /* * Initialise CMOS clock access method, only for direct I/O ports mode. * Set the global variable port_fd to a file descriptor for /dev/port. * This function can safely be called repeatedly (does nothing the * second and following times). */ static void cmos_init_directisa () { #ifdef USE_INLINE_ASM_IO if (verbose) fprintf (stdout, "using I/O ports\n"); if (ioperm (0x70, 2, 1)) { fprintf (stderr, "adjtimex: unable to get I/O port access\n"); exit (1); } #else if (port_fd >= 0) /* already initialised */ return; if (verbose) fprintf (stdout, "using /dev/port I/O\n"); if (port_fd < 0) port_fd = open ("/dev/port", O_RDWR); if (port_fd < 0) { perror ("adjtimex: unable to open /dev/port read/write"); exit (1); } if (verbose) fprintf (stdout, "opened /dev/port for reading\n"); if (lseek (port_fd, 0x70, 0) < 0 || lseek (port_fd, 0x71, 0) < 0) { perror ("adjtimex: unable to seek port 0x70 in /dev/port"); exit (1); } #endif } #define CMOS_READ(addr) ({outb(0x70,(addr)|0x80); inb(0x71);}) static inline int cmos_read_bcd (int addr) { int b; b = CMOS_READ (addr); return (b & 15) + (b >> 4) * 10; } static int timeout; /* An alarm signal has occurred */ static void alarm_handler (int const dummy) { timeout = 1; } /* * starts (or cancels) a 2 second timeout period * the global boolean timeout indicates that the timeout has been reached */ static void alarm_timeout (int onoff) { static struct sigaction oldaction; if (onoff) { struct sigaction action; action.sa_handler = &alarm_handler; sigemptyset(&action.sa_mask); action.sa_flags = 0; sigaction(SIGALRM, &action, &oldaction); /* Install our signal handler */ timeout = 0; /* reset global timeout flag */ alarm(2); /* generate SIGALARM 2 seconds from now */ } else { alarm(0); /* cancel alarm */ sigaction(SIGALRM, &oldaction, NULL); /* remove our signal handler */ } } /* return CMOS time in CMOS_TIMEP and sytem time in SYSP. cmos_init() must have been called before this function. */ static void cmos_read_time (time_t *cmos_timep, double *sysp) { int rc; struct tm tm; static int summertime_correction=0; static int sanity_checked=0; time_t cmos_time; struct timeval now; int noint_fallback = 1; /* detect tick by 0 => uip, 1 => time change */ int got_tick = 0; int got_time = 0; int saveerr; int type_uie, count; double update_delay; if (using_dev_rtc > 0) /* access the CMOS clock thru /dev/rtc */ { if (!nointerrupt) /* get RTC tick via update interrupt */ { struct timeval before; gettimeofday(&before, NULL); /* Ordinarily, reading /dev/rtc does not wait until the beginning of the next second. It only returns the current timer value, so it's only accurate to 1 sec which isn't good enough for us. I see this comment in drivers/char/rtc.c, function rtc_get_rtc_time(), in the kernel sources: * read RTC once any update in progress is done. The update * can take just over 2ms. We wait 10 to 20ms. There is no need to * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP. * If you need to know *exactly* when a second has started, enable * periodic update complete interrupts, (via ioctl) and then * immediately read /dev/rtc which will block until you get the IRQ. * Once the read clears, read the RTC time (again via ioctl). Easy. */ ioctl (cmos_fd, RTC_PIE_OFF, NULL); /* disable periodic interrupts */ rc = ioctl (cmos_fd, RTC_UIE_ON, NULL); /* enable update complete interrupts */ if (rc == -1) /* no interrupts? fallback to busywait */ { if (verbose) fprintf(stdout, "%s doesn't allow user access to update interrupts\n" " - using busy wait instead\n", cmos_device); nointerrupt = 1; } else /* wait for update-ended interrupt */ { unsigned long interrupt_info; if (verbose) fprintf (stdout, "waiting for CMOS update-ended interrupt\n"); do { { /* avoid blocking even if /dev/rtc never becomes readable */ fd_set readfds; struct timeval tv; int retval; FD_ZERO(&readfds); FD_SET(cmos_fd, &readfds); tv.tv_sec=2; tv.tv_usec=0; /* wait up to 2 sec */ retval = select(cmos_fd+1, &readfds, NULL, NULL, &tv); if (retval <= 0) { ioctl (cmos_fd, RTC_UIE_OFF, NULL); /* disable update complete interrupts */ if (retval == -1) perror("select()"); if (!retval) if (verbose) fprintf(stdout, "timeout waiting for a CMOS update interrupt from %s\n" " - using busy wait instead\n", cmos_device); nointerrupt = 1; goto directisa; } } rc = read(cmos_fd, &interrupt_info, sizeof(interrupt_info)); saveerr = errno; gettimeofday(&now, NULL); if (rc == -1) { /* no timeout, but read(/dev/rtc) failed for another reason */ char message[128]; snprintf(message, sizeof(message), "adjtimex: " "read() from %s to wait for clock tick failed", cmos_device); perror(message); exit(1); } type_uie = (int)(interrupt_info & 0x80); count = (int)(interrupt_info >> 8); } while (((type_uie == 0) || (count > 1)) && !nointerrupt); /* The low-order byte holds the interrupt type. The first read may succeed immediately, but in that case the byte is zero, so we know to try again. If there has been more than one interrupt, then presumably periodic interrupts were enabled. We need to try again for just the update interrupt. */ update_delay = (now.tv_sec + .000001*now.tv_usec) - (before.tv_sec + .000001*before.tv_usec); if ((type_uie) && (count == 1) && (update_delay > .001)) got_tick = 1; else { if (verbose) fprintf(stdout, "CMOS interrupt with status " "0x%2x came in only %8.6f sec\n" " - using busy wait instead\n", (unsigned int)interrupt_info&0xff, update_delay); nointerrupt = 1; } } /* end of successful RTC_UIE_ON case */ } /* end of interrupt tryouts */ /* At this stage, we either just detected the clock tick via an update interrupt, or detected nothing yet (interrupts were bypassed, unavailable, or timeouted). Fallback to busywaiting for the tick. */ directisa: if (!got_tick) { if (noint_fallback) { busywait_second_change(&tm, &now); got_time = 1; } else busywait_uip_fall(&now); got_tick = 1; } /* At this stage, we just detected the clock tick, by any method. Now get this just beginning RTC second, unless we already have it */ if (!got_time) { rc = ioctl (cmos_fd, RTC_RD_TIME, &tm); /* RTC_RD_TIME can fail when the device driver detects that the RTC isn't running or contains invalid data. Such failure has been detected earlier, unless: We used noint_fallback=1 to get busywait_uip_fall() as fallback. Or: UIE interrupts do beat, but RTC is invalid. */ if (rc == -1) { char message[128]; snprintf(message, sizeof(message), "adjtimex: " "ioctl(%s, RTC_RD_TIME) to read the CMOS clock failed", cmos_device); perror(message); exit(1); } } /* disable update complete interrupts It could seem more natural to do this above, just after we actually got the interrupt. But better do it here at the end, after all time-critical operations including the RTC_RD_TIME. */ ioctl (cmos_fd, RTC_UIE_OFF, NULL); } else /* access the CMOS clock thru I/O ports */ { /* The "do" loop is "low-risk programming" */ /* In theory it should never run more than once */ do { busywait_uip_fall(&now); tm.tm_sec = cmos_read_bcd (0); tm.tm_min = cmos_read_bcd (2); tm.tm_hour = cmos_read_bcd (4); tm.tm_wday = cmos_read_bcd(6)-1;/* RTC uses 1 - 7 for day of the week, 1=Sunday */ tm.tm_mday = cmos_read_bcd (7); tm.tm_mon = cmos_read_bcd(8)-1; /* RTC uses 1 base */ /* we assume we're not running on a PS/2, where century is in byte 55 */ tm.tm_year = cmos_read_bcd(9)+100*cmos_read_bcd(50)-1900; } while (tm.tm_sec != cmos_read_bcd (0)); } tm.tm_isdst = -1; /* don't know whether it's summer time */ if (universal) cmos_time = mkgmtime(&tm); else cmos_time = mktime(&tm); cmos_time += summertime_correction; if (verbose) printf ("CMOS time %s (%s) = %ld\n", asctime (&tm), universal?"assuming UTC": (summertime_correction?"assuming local time with summer time adjustment": "assuming local time without summer time adjustment"), cmos_time); if (!sanity_checked) { /* There are clues to whether the CMOS clock is set to summer time, which could be used as suggested by Alain Guibert : Since version 2.5, hwclock records CMOS timezone UTC or LOCAL as 1st item of 3rd line of /etc/adjtime. If it's "UTC", take offset 0 as if --utc was used. Otherwise: Since version 2.20, hwclock records CMOS timezone offset in 3rd item of 3rd line of /etc/adjtime. If it's there, take it. Otherwise if last adjustment date (2nd item of 1st line) exists and is not zero, take timezone offset at this last write time. Otherwise take the possibly false current offset. However, /etc/adjtime cannot be relied on. The user might have booted Windows, which could have adjusted the CMOS clock (including a summer time correction) without updating /etc/adjtime. Instead, we use a heuristic: if the CMOS and system times differ by more than six minutes, try shifting the CMOS time by some multiple of one hour. */ if (now.tv_sec 13*60*60) { printf("WARNING: CMOS time %ld differs from system time %ld by %3.2f hours\n", cmos_time, now.tv_sec, (summertime_correction)/3600.); if(logging) { printf("logging suppressed\n"); logging=0; } } if (verbose && summertime_correction) printf("adjusting CMOS times by %d hour\n", summertime_correction/(60*60)); cmos_time += summertime_correction; /* assume start/end of summer time or local time/UTC difference */ if (abs(cmos_time-now.tv_sec)>6*60) /* still different by more than 6 min? */ { if (cmos_time>now.tv_sec) printf("WARNING: CMOS time is %3.2f min ahead of system clock\n", (cmos_time-now.tv_sec)/60.); else printf("WARNING: CMOS time is %3.2f min behind system clock\n", (now.tv_sec-cmos_time)/60.); if(logging) { printf("logging suppressed\n"); logging=0; } } sanity_checked=1; } *cmos_timep=cmos_time; *sysp = now.tv_sec + .000001*now.tv_usec; } /* * busywait for UIP fall and timestamp this event * * Maintainance note: In order to detect its fall, we first have to * detect the update-in-progress flag up state. This UIP up state lasts * for 2 ms each second. Detecting a 2 ms event, when other processes * can steal us one or several 10 ms timeslices, this is something that * can very easily fail. We *can* miss a second tick, or even several in * a row, under heavy system load. Missing ticks is not a severe problem * for adjtimex, as long as we timestamp accurately the tick we'll * finally catch. However there is a timeout issue: we can't just arm an * alarm_timeout() for 2 seconds, as when waiting for UIE interrupts and * in busywait_second_change(), because it would make us hard fail after * only one or two missed ticks. */ static void busywait_uip_fall(struct timeval *timestamp) { long i; /* * Initialise direct I/O access mode. * This may have been already done previously by the main * initialisation cmos_init(), if the CMOS access mode is direct I/O. * We init it here again, to make busywait_uip_fall() usable in any * other CMOS access modes (/dev/rtc). */ cmos_init_directisa(); if (verbose>1) fprintf (stdout, " waiting for CMOS update-in-progress fall\n"); /* read RTC exactly on falling edge of update-in-progress flag */ /* Wait for rise.... (may take up to 1 second) */ for (i = 0; i < 10000000; i++) if (CMOS_READ (10) & 0x80) break; /* Wait for fall.... (must try at least 2.228 ms) */ for (i = 0; i < 1000000; i++) if (!(CMOS_READ (10) & 0x80)) { gettimeofday(timestamp, NULL); break; } } /* * Busywait for a change in RTC time and timestamp this event. * cmos_init() must have been called before, and the selected * access method must be using_dev_rtc=1. * * Important note: an ioctl(RTC_RD_TIME) call that happens while the RTC * is updating itself (UIP up, a 2 milliseconds long event) will block. * Properly block until UIP release on recent Linux kernels since 2.6.13. * However all older Linux kernels had a misfeature: they blocked much * longer than necessary, up to 20 ms longer in the worst case. * The method used here cannot detect precisely the CMOS clock tick on * such older kernels. It would result in a random delay, the timestamp * being between 8 and 18 ms late. Hell: that's 3 orders of magnitude * worse than the accuracy expected from this function. */ static void busywait_second_change(struct tm *cmos, struct timeval *timestamp) { struct tm begin; int rc; if (verbose) fprintf (stdout, "waiting for CMOS time change\n"); alarm_timeout(1); /* arm a 2 seconds timeout */ /* pick a reference time */ rc = ioctl (cmos_fd, RTC_RD_TIME, &begin); /* RTC_RD_TIME can fail when the device driver detects that the RTC isn't running or contains invalid data */ if (rc == -1) { char message[128]; snprintf(message, sizeof(message), "adjtimex: " "ioctl(%s, RTC_RD_TIME) to read the CMOS clock failed", cmos_device); perror(message); exit(1); } /* loop until time changes */ do { ioctl (cmos_fd, RTC_RD_TIME, cmos); } while ((cmos->tm_sec == begin.tm_sec) && !timeout); gettimeofday(timestamp, NULL); alarm_timeout(0); /* disable timeout */ /* Sometimes the RTC isn't running, but the device driver didn't notice. Then the RTC_RD_TIME call succeeds, but provides us some static wrong time. That's why we needed an alarm timeout */ /* timeout without a change? */ if (cmos->tm_sec == begin.tm_sec) { fprintf(stderr, "adjtimex: timeout waiting for CMOS time change on %s\n" "The CMOS clock appears to be stopped:\n" "Please try to set and restart it with hwclock --systohc\n", cmos_device); exit (1); } } static inline void xusleep(long microseconds) { struct timespec ts; ts.tv_sec = microseconds/1000000; ts.tv_nsec = (microseconds - ts.tv_sec*1000000) * 1000; while (nanosleep (&ts, &ts) < 0) continue; } /* compare the system and CMOS clocks. If "adjusting" is nonzero, adjust sytem time to match the CMOS clock. */ void compare() { struct timex txc; time_t cmos_time; double cmos_sec, system_sec, dif, dif_prev = 0.; struct cmos_adj *pca = get_cmos_adjustment(); double cmos_adjustment; int loops = 0; extern char *optarg; int wrote_to_log = 0; int hz, tick_min, tick_mid, tick_max; long maxfreq; struct timeval tv_dummy; /* dummy training call: the next important timestamp will be more accurate */ gettimeofday(&tv_dummy, NULL); probe_time(&hz, &tick_min, &tick_mid, &tick_max, &maxfreq); #ifdef DEBUG /* cmos clock last adjusted at Tue Aug 26 11:43:57 1997 (= 872610237) current cmos time Tue Aug 26 21:27:05 1997 EDT (= 872645225) */ { struct tm bdt; if (universal) { bdt = *gmtime(&pca->ca_adj_time); (void)mkgmtime(&bdt); /* set tzname */ } else { bdt = *localtime(&pca->ca_adj_time); (void)mktime(&bdt); /* set tzname */ } printf ("cmos clock last adjusted %.24s %s " "(= %ld)\n", ctime(&pca->ca_adj_time), tzname[tm.tm_isdst?1:0], (long) pca->ca_adj_time); } #endif cmos_init (); while (count != 0) { if (count > 0) count--; cmos_read_time (&cmos_time, &system_sec); /* If we're adjusting time parameters, we want to make a log entry only for the first two comparisons (before we change the parameters). Otherwise, we want to log the first and last comparisons in order to maximize the duration. */ if (logging && (wrote_to_log ^ (adjusting?(loops==0):(count!=0)))) { struct hack h; h.ref = 0; h.sigma_ref = 0; h.log = (time_t)system_sec; h.sys = system_sec; txc.modes = 0; adjtimex(&txc); h.tick = txc.tick; h.freq = txc.freq; h.sys_ok = wrote_to_log; h.cmos = cmos_time; h.cmos_ok = wrote_to_log; puthackent(&h); wrote_to_log = 1; } #ifdef DEBUG tm=*gmtime(cmos_time); printf (" current cmos time %.24s %s (= %ld)\n", asctime(&tm), tzname[tm.tm_isdst?1:0], (long) cmos_time); #endif cmos_adjustment = ((double) (cmos_time - pca->ca_adj_time)) * pca->ca_factor / SECONDSPERDAY + pca->ca_remainder; cmos_sec = cmos_time + cmos_adjustment; #ifdef DEBUG printf ( " time since last adjustment %10.6f days (= %9d sec)\n", (int) (cmos_time - pca->ca_adj_time) / (double)SECONDSPERDAY, (int) (cmos_time - pca->ca_adj_time)); printf ( " factor %10.6f sec/day\n", pca->ca_factor); printf ( " adjustment %10.6f + %7.6f = %7.6f sec\n", ((double) (cmos_time - pca->ca_adj_time))*pca->ca_factor/SECONDSPERDAY, pca->ca_remainder, cmos_adjustment); #endif dif = system_sec - cmos_sec; txc.modes = 0; if (adjtimex (&txc) < 0) {perror ("adjtimex"); exit(1);} /* --- current --- -- suggested -- cmos time system-cmos error_ppm tick freq tick freq 1094939320 -14394.974188 1094939330 -14394.971203 298.5 10001 1290819 1094939340 -14394.968203 300.0 10001 1290819 9998 1289097 */ if (! marked++ ) { if (interval) printf ( " --- current --- -- suggested --\n" "cmos time system-cmos error_ppm tick freq tick freq\n"); else printf ( "cmos time system-cmos error_ppm tick freq\n"); } printf ("%10ld %13.6f", (long) cmos_sec, dif); if (++loops > 1) { /* print difference in rates */ #define SHIFT (1<<16) double second_diff, error_ppm; second_diff = dif - dif_prev; error_ppm = second_diff/interval*1000000; printf ("%11.1f %6ld %9ld", error_ppm, txc.tick, txc.freq); if (loops > 2) { /* print suggested values */ long tick_delta = 0, freq_delta = 0; tick_delta = ceil((-error_ppm + txc.freq/SHIFT - hz)/hz); freq_delta = -(error_ppm + tick_delta*hz)*SHIFT; printf(" %6ld %9ld\n", txc.tick + tick_delta, txc.freq + freq_delta); if (loops > 4 && adjusting) { if (abs(error_ppm)>10000) { if (!force_adjust) { printf( "\nERROR: required correction is greater than plus/minus 1 percent (10000 \n" "parts per million), quitting (use --force-adjust to override).\n"); if (resetting) reset_time_status(); exit(1); } } txc.modes = ADJ_FREQUENCY | ADJ_TICK; txc.tick += tick_delta; txc.freq += freq_delta; if (adjtimex (&txc) < 0) { perror ("adjtimex"); exit(1); } if (resetting) reset_time_status(); loops -= 3; } } else printf("\n"); } else printf("\n"); dif_prev = dif; if (interval == 0) break; if (count) /* if it is not the last round */ xusleep (interval*1000000L - 500000); /* reading RTC takes 1 sec */ } } void reset_time_status() { /* Using the adjtimex(2) system call to set any time parameter makes an early kernel (2.0.40 and 2.4.18 or later are reportedly okay) think the clock is synchronized with an external time source, so it sets the kernel variable time_status to TIME_OK. Thereafter, it will periodically adjust the CMOS clock to match. We prevent this by setting the clock, because that has the side effect of resetting time_status to TIME_BAD. We try not to actually change the clock setting. */ struct timeval tv1, tv2; long carry_sec, overhead_usec; if (gettimeofday(&tv1, NULL)) {perror("adjtimex"); exit(1);} if (gettimeofday(&tv2, NULL)) {perror("adjtimex"); exit(1);} overhead_usec = tv2.tv_usec - tv1.tv_usec + 1000000*(tv2.tv_sec - tv1.tv_sec); tv2.tv_usec += overhead_usec; carry_sec = tv2.tv_usec/1000000; tv2.tv_sec += carry_sec; tv2.tv_usec -= 1000000*carry_sec; if (settimeofday(&tv2, NULL)) {perror("adjtimex"); exit(1);} } static void log_times() { #ifdef NET_TIME_CLIENT struct protoent proto; int sockfd, val, len, c; struct sockaddr sa={AF_INET, "127.0.0.1"}; struct hostent he; #endif double sigma_ref; char ch, buf[64], *s; int n, ret; struct timeval tv_sys; struct tm bdt; time_t when, tref; double ftime_ref, ftime_sys, ftime_cmos; /* dummy training call: the next important timestamp will be more accurate */ gettimeofday(&tv_sys, NULL); if (watch) { while(1) { printf("Please press when you know the time of day: "); ch = getchar(); gettimeofday(&tv_sys, NULL); when = tv_sys.tv_sec; bdt = *localtime(&when); /* set default values for most fields */ strftime(buf, sizeof(buf), "%Z", &bdt); printf(" system time then was %.24s %s\n", asctime(&bdt), buf); ftime_sys = tv_sys.tv_sec + tv_sys.tv_usec*.000001; printf("What time was that according to your reference (%s)?\n" "(hh:mm:ss, or `r' to retry, or `q' to quit): ", buf); if (fgets(buf, sizeof(buf), stdin) == NULL) exit(1); s = buf; while(isspace(*s)) s++; if (*s == 'q') exit(0); if (*s == 'r') continue; strptime(buf, "%T", &bdt); /* set time fields from user input */ printf(" reference time is %s", asctime(&bdt)); tref = ftime_ref = mktime(&bdt); /* construct a time_t corresponding to the user input */ printf(" mktime returns time of %s", ctime(&tref)); printf("reference time - system time = %12.3f - %12.3f " "= %4.3f sec\n", ftime_ref, ftime_sys, ftime_ref - ftime_sys); printf("How big could the error be in this, in seconds?\n" "(or `r' to retry, or `q' to quit) [.5] : "); if (fgets(buf, sizeof(buf), stdin) == NULL) exit(1); s = buf; while(isspace(*s)) s++; if (*s == 'q') exit(0); if (*s == 'r') continue; n = sscanf(buf, "%lf", &sigma_ref); if (n < 1) sigma_ref = .5; else if (sigma_ref < .02) { printf("You get credit for .02 sec.\n"); sigma_ref = .02; } break; } } else if (timeserver) { FILE *ifile; char command[128]; char buf[BUFLEN]; int i, j; double d, mean=0, val, var=0, num=0; /* for finding statistics */ struct stat filestat; char *paths[]={"/usr/bin/ntpdate","/bin/ntpdate", "/usr/sbin/ntpdate","/sbin/ntpdate"}; for (i=0; i0 && (strstr(buf,"adjust time server") || strstr(buf,"step time server"))) goto ntpdate_okay; } failntpdate("cannot understand ntpdate output"); ntpdate_okay: gettimeofday(&tv_sys, NULL); ftime_sys = tv_sys.tv_sec; /* ntpdate selects the offset from one of its samples (the one with the shortest round-trip delay?) */ ftime_ref = ftime_sys + atof(strstr(buf, "offset") + 6); pclose(ifile); sigma_ref = sqrt(var); { time_t now = (time_t)ftime_ref; bdt = *gmtime(&now); printf(" reference time is %s", ctime(&now)); printf("reference time - system time = %12.3f - %12.3f " "= %4.3f sec\n", ftime_ref, ftime_sys, ftime_ref - ftime_sys); } #ifdef OWN_IMPLEMENTATION /* this is not even close to working yet */ proto = *getprotobyname("UDP"); sockfd = socket(AF_INET, SOCK_DGRAM, proto.p_proto); he = *gethostbyname("localhost"); len = he.h_length; memcpy(sa.sa_data, he.h_addr_list[0], len); #ifdef SEND val = connect(sockfd, &sa, len); if (val == -1) {perror("connect"); exit(1);} /* int connect(int sockfd, struct sockaddr *serv_addr, int addrlen ); int send(int s, const void *msg, int len , unsigned int flags); int sendto(int s, const void *msg, int len unsigned int flags, const struct sockaddr *to, int tolen); */ #endif /* SEND */ val = sendto(sockfd, (const void *)" ", 1, 0, &sa, len); if (val == -1) {perror("sendto"); exit(1);} sigma_ref = .010; #endif /* OWN_IMPLEMENTATION */ } else /* no absolute time reference */ { time_t now; gettimeofday(&tv_sys, NULL); now = (time_t)tv_sys.tv_sec; bdt = *gmtime(&now); ftime_sys = tv_sys.tv_sec + tv_sys.tv_usec*.000001; ftime_ref = 0; sigma_ref = 0; } { time_t cmos_time; double system_sec; cmos_init (); cmos_read_time (&cmos_time, &system_sec); ftime_cmos = ftime_sys + cmos_time - system_sec; } /* -reference-time- --------system-time---------- --cmos-time---- 1997-06-14 20:22 888888888.888 -3 888888888.888 10000 6666666 n 888888888.888 y */ { struct hack h; h.ref = ftime_ref; h.sigma_ref = sigma_ref; h.log = (time_t)ftime_ref; h.sys = ftime_sys; txc.modes = 0; ret = adjtimex(&txc); h.tick = txc.tick; h.freq = txc.freq; h.sys_ok = valid_system_rate(ftime_sys, ftime_ref, sigma_ref); h.cmos = ftime_cmos; h.cmos_ok = valid_cmos_rate(ftime_cmos, ftime_ref, sigma_ref); puthackent(&h); } } void failntpdate(char *s) { fprintf(stderr, "%s\n", s); exit(1); } static int valid_system_rate(double ftime_sys, double ftime_ref, double sigma_ref) { int n; int default_answer; int ch; char buf[BUFLEN]; struct hack *ph; struct cmos_adj *pca = get_cmos_adjustment(); sethackent(); for (n = 0; (ph = gethackent()); n++) prev = *ph; /* fetch last line from logfile */ endhackent(); if (n == 0) { printf("No previous clock comparison in log file\n"); return 0; } undisturbed_sys = undisturbed_cmos = 1; printf("Last clock comparison was at %.24s\n", ctime(&prev.log)); if (txc.tick == prev.tick && txc.freq == prev.freq) printf("Kernel time variables are unchanged - good.\n"); else { printf("Kernel time variables have changed - bad.\n"); undisturbed_sys = 0; } if (txc.status & 64) printf("System clock is currently not disciplined - good.\n"); else { printf("System clock is synchronized (by ntpd?) - bad.\n"); undisturbed_sys = 0; } { time_t lastboot, newtime; struct utmp *up; lastboot = newtime = prev.sys - 1; utmpname(WTMP_PATH); setutent(); printf("Checking wtmp file...\n"); while((up = getutent())) { if (up->ut_type == BOOT_TIME) lastboot = up->ut_time; if (up->ut_type == NEW_TIME) newtime = up->ut_time; } endutent(); if (lastboot < prev.sys) printf("System has not booted since %.24s - good.\n", ctime(&prev.log)); else { printf("System was booted at %.24s - bad.\n", ctime(&lastboot)); undisturbed_sys = 0; } if (newtime < prev.sys) printf("System time has not been changed since %.24s - good.\n", ctime(&prev.log)); else { printf("System time was reset at %.24s - bad.\n", ctime(&newtime)); undisturbed_sys = 0; } } if (pca) { printf("Checking %s...\n", ADJPATH); if (pca->ca_adj_time < prev.log) printf( "/sbin/hwclock has not set system time and adjusted the cmos clock \n" "since %.24s - good.\n", ctime(&prev.log)); else { printf("/sbin/hwclock set system time and adjusted the cmos clock \n" "at %.24s - bad.\n", ctime(&pca->ca_adj_time)); undisturbed_sys = undisturbed_cmos = 0; } } do { default_answer = undisturbed_sys?'y':'n'; printf("\nAre you sure that, since %.24s,\n", ctime(&prev.log)); printf(" the system clock has run continuously,\n"); printf(" it has not been reset with `date' or `/sbin/hwclock`,\n"); printf(" the kernel time variables have not been changed, and\n"); printf(" the computer has not been suspended? (y/n) [%c] ", default_answer); fgets(buf, BUFLEN, stdin); ch = buf[0]; if (ch == '\n') ch = default_answer; } while (ch != 'n' && ch != 'y'); if ((undisturbed_sys = (ch == 'y'))) { double drift_sys_ppm, err_sys_ppm; int digits; drift_sys_ppm = ((ftime_sys - ftime_ref) - (prev.sys - prev.ref))* 1.e6/(ftime_ref - prev.ref); err_sys_ppm = (prev.sigma_ref + sigma_ref)*1.e6/ (ftime_ref - prev.ref); digits = -(int)floor(log(.5*sigma_ref)/log(10.)); if (digits < 0) digits = 0; printf("The estimated error in system time is %.*f +- %.*f ppm\n", digits, drift_sys_ppm, digits, err_sys_ppm); } return undisturbed_sys; } static int valid_cmos_rate(double ftime_cmos, double ftime_ref, double sigma_ref) { int default_answer; int ch; char buf[BUFLEN]; default_answer = undisturbed_cmos?'y':'n'; do { printf("\nAre you sure that, since %.24s,\n", ctime(&prev.log)); printf(" the real time clock (cmos clock) has run continuously,\n"); printf(" it has not been reset with `/sbin/hwclock',\n"); printf(" no operating system other than Linux has been running, and\n"); printf(" ntpd has not been running? (y/n) [%c] ", default_answer); fgets(buf, BUFLEN, stdin); ch = buf[0]; if (ch == '\n') ch = default_answer; } while (ch != 'n' && ch != 'y'); if ((undisturbed_cmos = (ch == 'y'))) { double drift_cmos_ppm, err_cmos_ppm; int digits; drift_cmos_ppm = ((ftime_cmos - ftime_ref) - (prev.cmos - prev.ref))* 1.e6/(ftime_ref - prev.ref); err_cmos_ppm = (prev.sigma_ref + sigma_ref)*1.e6/ (ftime_ref - prev.ref); digits = -(int)floor(log(.5*err_cmos_ppm)/log(10.)); if (digits < 0) digits = 0; printf("The estimated error in the cmos clock is %.*f +- %.*f ppm\n", digits, drift_cmos_ppm, digits, err_cmos_ppm); } return undisturbed_cmos; } /* * Read informations from /etc/adjtime file. * If file doesn't exist, return default zero values. */ static struct cmos_adj *get_cmos_adjustment() { FILE *adj; static struct cmos_adj ca; ca.ca_factor = ca.ca_adj_time = ca.ca_remainder = 0; if ((adj = fopen (ADJPATH, "r")) != NULL) { if (fscanf (adj, "%lf %ld %lf", &ca.ca_factor, &ca.ca_adj_time, &ca.ca_remainder) < 0) { perror (ADJPATH); exit (2); } fclose (adj); } #ifdef DEBUG printf ("CMOS clock was last adjusted %s\n", ctime(&ca.ca_adj_time)); #endif return &ca; } static FILE *lfile; /* pointer to log file, or NULL if it has not been opened yet */ static void sethackent(void) { endhackent(); lfile = fopen(log_path, "r"); if (!lfile && logging) { lfile = fopen(log_path, "a+"); /* create it if it doesn't exist */ if (!lfile) { fprintf(stderr, "%s does not exist, and could not be created\n", log_path); exit(1); } fseek(lfile, 0L, 0); /* start at beginning */ } } static void endhackent(void) { if (lfile) fclose(lfile); lfile = NULL; } /* read next entry in clock comparison log, fill a struct hack from it, and return a pointer to it. Ignore lines starting with `#'. Return NULL when there are no more lines to read. */ static struct hack *gethackent(void) { char buf[256], sys_flag, cmos_flag, junk[26]; static struct hack h; if (!lfile) sethackent(); if (!lfile) return NULL; while(fgets(buf, sizeof(buf), lfile)) { int tokens; if (buf[0] == '#') continue; tokens = sscanf(buf, "%25s %25s %lf %lf %lf %d %d %c %lf %c", junk, junk, &h.ref, &h.sigma_ref, &h.sys, &h.tick, &h.freq, &sys_flag, &h.cmos, &cmos_flag); if (tokens != 10) continue; h.sys_ok = (tolower(sys_flag) == 'y'); h.cmos_ok = (tolower(cmos_flag) == 'y'); if (h.ref) h.log = (time_t)h.ref; else if (h.sys) h.log = (time_t)h.sys; else h.log = (time_t)h.cmos; h.valid = 0; return &h; } return NULL; } /* append an entry to the clock comparison log. */ static void puthackent(struct hack *ph) { struct tm bdt; char timestring[32]; int digits; if (ph->sigma_ref) ph->log = (time_t)ph->ref; else ph->log = (time_t)ph->sys; bdt = *gmtime(&ph->log); strftime(timestring, sizeof(timestring), "%Y-%m-%d %H:%M", &bdt); if (ph->sigma_ref <= 0.) digits = 0; else { digits = -(int)floor(log(.5*ph->sigma_ref)/log(10.)); if (digits < 0) digits = 0; } if (verbose) { fprintf(stdout, "\nlog entry:\n"); fprintf(stdout, "%s %.*f %.*f %13.3f %5d %7d %s %13.3f %s\n", timestring, digits, ph->ref, digits, ph->sigma_ref, ph->sys, ph->tick, ph->freq, ph->sys_ok?"y":"n", ph->cmos, ph->cmos_ok?"y":"n"); } if (!logging) fprintf(stdout, "logging suppressed\n"); else { lfile = fopen(log_path, "a+"); if (!lfile) { fprintf(stderr, "cannot open %s for writing\n", log_path); return; } fprintf(lfile, "%s %.*f %.*f %13.3f %5d %7d %s %13.3f %s\n", timestring, digits, ph->ref, digits, ph->sigma_ref, ph->sys, ph->tick, ph->freq, ph->sys_ok?"y":"n", ph->cmos, ph->cmos_ok?"y":"n"); fclose(lfile); lfile = NULL; if (verbose) fprintf(stdout, "written to %s\n", log_path); } } /* convert a broken-down time representing UTC to calendar time representation (time_t), and return it. As a side effect, set the tm_wday and tm_yday members of the broken-down time. (like mktime) */ static time_t mkgmtime(struct tm *tp) { time_t lt; /* local time */ long adj; struct tm u; static char timezone_name[]="UTC"; lt = mktime(tp); if (lt == (time_t)(-1)) return (time_t)(-1); adj = 131072; /* greater than the number of seconds per day (even when daylight savings time ends) */ lt -= adj; while (adj) { lt += adj; u = *gmtime(<); if (compare_tm(&u, tp) > 0) lt -= adj; adj /= 2; } u = *gmtime(<); if (compare_tm(&u, tp)) return (time_t)(-1); tzname[0] = tzname[1] = timezone_name; return lt; } static int compare_tm(struct tm *first, struct tm *second) { if (first->tm_year < second->tm_year) return -1; if (first->tm_year > second->tm_year) return 1; if (first->tm_mon < second->tm_mon) return -1; if (first->tm_mon > second->tm_mon) return 1; if (first->tm_mday < second->tm_mday) return -1; if (first->tm_mday > second->tm_mday) return 1; if (first->tm_hour < second->tm_hour) return -1; if (first->tm_hour > second->tm_hour) return 1; if (first->tm_min < second->tm_min) return -1; if (first->tm_min > second->tm_min) return 1; if (first->tm_sec < second->tm_sec) return -1; if (first->tm_sec > second->tm_sec) return 1; return 0; } static void *xmalloc(int n) { void *p; p = xrealloc(NULL, n); return p; } static void *xrealloc(void *pv, int n) { void *p; p = realloc(pv, n); if (!p){perror("adjtimex"); exit(1);} return p; } /* review log file and find least-square estimates of drifts. If "adjusting" is nonzero, set sytem time parameters to the least-squares estimates. */ static void review() { int i, n, nmax = 0, digits; struct hack *ph, **hacks = NULL; double diff_ppm, sigma_ppm, cmos_time, sys_time, s0, s1, ref_time; time_t start, finish; char startstring[26], finishstring[26]; double x[2], p[4], h[4], z[2], r[4], cmos_var, sys_var, ref_var; long tick_delta = 0; double error_ppm = 0; int hz, tick_min, tick_mid, tick_max; long maxfreq; probe_time(&hz, &tick_min, &tick_mid, &tick_max, &maxfreq); /* read all the previous time hacks in */ sethackent(); for (n = 0; (ph = gethackent()); n++) { if (nmax <= n) { hacks = xrealloc(hacks, (nmax = 2*nmax + 4)*sizeof(struct hack *)); } hacks[n] = xmalloc(sizeof(struct hack)); *hacks[n] = *ph; } endhackent(); if (n == 0) { printf("No previous clock comparison in log file\n"); return; } /* In the following, we assume the reference times are most accurate, then the CMOS clock, then the system clock. Hence, when comparing CMOS and reference times, we're calculating the error in PPM of the CMOS rate, and when comparing system time to either CMOS or reference times, we're calculating error in PPM of the system rate. For system time, we're calculating the error if TICK is set to the middle of the rnage, and FREQ is zero. */ /* compare cmos and system rates */ printf( "start finish days sys - cmos (ppm)\n"); for (i = 1; i < n; i++) { if (hacks[i]->sys_ok && hacks[i]->cmos_ok && hacks[i]->sys > hacks[i-1]->sys && hacks[i]->cmos > hacks[i-1]->cmos) { sys_time = hacks[i]->sys - hacks[i-1]->sys; cmos_time = hacks[i]->cmos - hacks[i-1]->cmos; hacks[i]->relative_rate = diff_ppm = 1.e6*(sys_time - cmos_time)/sys_time - 100*(hacks[i]->tick - tick_mid) - hacks[i]->freq/SHIFT; if (fabs(diff_ppm) > 10000.) /* agree within 1 percent? */ continue; hacks[i]->valid = CMOS_VALID | SYS_VALID; hacks[i]->relative_sigma = sigma_ppm = 1.e6*RTC_JITTER*sqrt(2.)/(sys_time + cmos_time); start = (time_t)hacks[i-1]->sys; strcpy(startstring, ctime(&start)); finish = (time_t)hacks[i]->sys; strcpy(finishstring, ctime(&finish)); digits = -(int)floor(log(.5*sigma_ppm)/log(10.)); if (digits < 0) digits = 0; printf("%.24s %.24s %6.4f %.*f +- %.*f\n", startstring, finishstring, sys_time/SECONDSPERDAY, digits, diff_ppm, digits, sigma_ppm); } } /* compare cmos and reference rates */ printf( "start finish days cmos_error (ppm)\n"); for (i = 1; i < n; i++) { if (hacks[i]->sigma_ref != 0 && hacks[i-1]->sigma_ref != 0 && hacks[i]->cmos_ok && hacks[i]->cmos > hacks[i-1]->cmos && hacks[i]->ref > hacks[i-1]->ref) { ref_time = hacks[i]->ref - hacks[i-1]->ref; cmos_time = hacks[i]->cmos - hacks[i-1]->cmos; hacks[i]->cmos_rate = diff_ppm = 1.e6*(cmos_time - ref_time)/cmos_time; if (fabs(diff_ppm) > 10000.) /* agree within 1 percent? */ continue; hacks[i]->valid |= CMOS_VALID | REF_VALID; s0=hacks[i-1]->sigma_ref; s1=hacks[i]->sigma_ref; hacks[i]->cmos_sigma = sigma_ppm = 1.e6*sqrt(s0*s0 + s1*s1)/ref_time; start = (time_t)hacks[i-1]->sys; strcpy(startstring, ctime(&start)); finish = (time_t)hacks[i]->sys; strcpy(finishstring, ctime(&finish)); digits = -(int)floor(log(.5*sigma_ppm)/log(10.)); if (digits < 0) digits = 0; printf("%.24s %.24s %6.4f %1.*f +- %1.*f\n", startstring, finishstring, ref_time/SECONDSPERDAY, digits, diff_ppm, digits, sigma_ppm); } } /* compare sys and reference rates */ printf( "start finish days sys_error (ppm)\n"); for (i = 1; i < n; i++) { if (hacks[i]->sigma_ref != 0 && hacks[i-1]->sigma_ref != 0 && hacks[i]->sys_ok && hacks[i]->sys > hacks[i-1]->sys && hacks[i]->ref > hacks[i-1]->ref) { ref_time = hacks[i]->ref - hacks[i-1]->ref; sys_time = hacks[i]->sys - hacks[i-1]->sys; hacks[i]->sys_rate = diff_ppm = 1.e6*(sys_time - ref_time)/sys_time - 100*(hacks[i]->tick - tick_mid) - hacks[i]->freq/SHIFT; if (fabs(diff_ppm) > 10000.) /* agree within 1 percent? */ continue; hacks[i]->valid |= REF_VALID | SYS_VALID; s0=hacks[i-1]->sigma_ref; s1=hacks[i]->sigma_ref; hacks[i]->sys_sigma = sigma_ppm = 1.e6*sqrt(s0*s0 + s1*s1)/ref_time; start = (time_t)hacks[i-1]->sys; strcpy(startstring, ctime(&start)); finish = (time_t)hacks[i]->sys; strcpy(finishstring, ctime(&finish)); digits = -(int)floor(log(.5*sigma_ppm)/log(10.)); if (digits < 0) digits = 0; printf("%.24s %.24s %6.4f %1.*f +- %1.*f\n", startstring, finishstring, ref_time/SECONDSPERDAY, digits, diff_ppm, digits, sigma_ppm); } } /* find least-squares solution incorporating all the data */ p[0] = 1.e10; p[1] = 0.; p[2] = 0.; p[3] = 1.e10; x[0] = 0.; x[1] = 0.; for (i = 1; i < n; i++) { switch(hacks[i]->valid) { case 0: break; case (CMOS_VALID | REF_VALID): /* update only the first component of the state (cmos rate) */ h[0] = 1.; h[1] = 0.; z[0] = hacks[i]->cmos_rate; r[0] = hacks[i]->cmos_sigma; r[0] *= r[0]; kalman_update(x, 2, p, h, z, 1, r); break; case (SYS_VALID | REF_VALID): /* update only the second component of the state (system rate) */ h[0] = 0.; h[1] = 1.; z[0] = hacks[i]->sys_rate; r[0] = hacks[i]->sys_sigma; r[0] *= r[0]; kalman_update(x, 2, p, h, z, 1, r); break; case (CMOS_VALID | SYS_VALID): /* update the difference between the system and cmos rates */ h[0] = -1.; h[1] = 1.; z[0] = hacks[i]->relative_rate; r[0] = hacks[i]->relative_sigma; r[0] *= r[0]; kalman_update(x, 2, p, h, z, 1, r); break; case (CMOS_VALID | SYS_VALID | REF_VALID): /* This is the interesting case. We have estimates of the cmos and system rates, but they are highly correlated because they contain the same errors in the reference times. Thus, we know the *difference* between the cmos and system rates much better than we know either of them independently. The r matrix describes the correlation. */ h[0] = 1.; h[1] = 0.; h[2] = 0.; h[3] = 1.; ref_var = hacks[i]->cmos_sigma*hacks[i]->cmos_sigma; cmos_var = hacks[i]->relative_sigma; cmos_var *= cmos_var; sys_var = cmos_var; r[0] = ref_var + 2.*cmos_var; r[1] = r[2] = ref_var; r[3] = ref_var + 2.*sys_var; z[0] = hacks[i]->cmos_rate; z[1] = hacks[i]->sys_rate; kalman_update(x, 2, p, h, z, 2, r); break; } } sigma_ppm = sqrt(p[0]); digits = -(int)floor(log(.5*sigma_ppm)/log(10.)); if (digits < 0) digits = 0; printf("least-squares solution:\n" " cmos_error = %.*f +- %.*f ppm\n", digits, x[0], digits, sigma_ppm); if (sigma_ppm < 100) printf(" suggested adjustment = %6.4f sec/day\n", -x[0]*SECONDSPERDAY/1.e6); else printf(" (no suggestion)\n"); { struct cmos_adj *pca = get_cmos_adjustment(); printf(" current adjustment = %6.4f sec/day\n", pca->ca_factor); } sigma_ppm = sqrt(p[3]); digits = -(int)floor(log(.5*sigma_ppm)/log(10.)); if (digits < 0) digits = 0; printf(" sys_error = %.*f +- %.*f ppm\n", digits, x[1], digits, sigma_ppm); if (sigma_ppm < hz) { error_ppm = x[1]; if (error_ppm > hz) tick_delta = -(error_ppm + hz/2)/hz; else if (error_ppm < -hz) tick_delta = (-error_ppm + hz/2)/hz; error_ppm += tick_delta*hz; printf(" suggested tick = %5ld freq = %9.0f\n", tick_mid + tick_delta, -error_ppm*SHIFT); if (abs(error_ppm)>500) printf ("WARNING: required correction is greater " "than plus/minus 500 parts per million.\n"); } else printf(" (no suggestion)\n"); { txc.modes = 0; adjtimex(&txc); printf(" current tick = %5ld freq = %9ld\n", txc.tick, txc.freq ); } printf( "note: clock variations and unstated data errors may mean that the\n" "least squares solution has a bigger error than estimated here\n"); if (sigma_ppm < 100 && adjusting) { if (abs(error_ppm)>500) { if (force_adjust) printf ( "\nWARNING: required correction is greater than plus/minus 500 parts \n" "per million, but adjusting anyway per your request.\n"); else { printf( "\nERROR: required correction is greater than plus/minus 500 parts \n" "per million, quitting (use --force-adjust to override).\n"); if (resetting) reset_time_status(); exit(1); } } txc.modes = ADJ_FREQUENCY | ADJ_TICK; txc.tick = tick_mid + tick_delta; txc.freq = -error_ppm*SHIFT; if (adjtimex (&txc) < 0) { perror ("adjtimex"); exit(1); } if (resetting) reset_time_status(); printf("new tick = %5ld freq = %7ld\n", txc.tick, txc.freq ); } for (i = 0; i < n; i++) free(hacks[i]); free(hacks); } /* Perform one update on a discrete linear Kalman filter. z is a measurement related to the state x by z = h x + v where v is the measurement error, normally distributed, with covariance r. Because of the size of the temporary arrays, this particular implementation is restricted to 2 states. There are no provisions here for propagating the state or its covariance between updates, because it is not required in this case (i.e. the state transition matrix is a unit matrix). See, for example: Blackman, "Multitarget Tracking with Radar Applications" */ static void kalman_update(double *x, /* state vector */ int xr, /* rows in x (must be 1 or 2) */ double *p, /* covariance matrix for x (has xr rows and columns) */ double *h, /* transforms from state space to measurement space (has zr rows and xr columns) */ double *z, /* measurement vector */ int zr, /* rows in z (must be 1 or 2) */ double *r) /* covariance matrix for z (has zr rows and columns) */ { static double k[4], num[4], denom[4], v[4], w[4]; int pr=xr, pc=xr, hr=zr, hc=xr, rr=zr, rc=zr, kr=xr, kc=zr, nr=xr, nc=zr, dr=zr, dc=zr, vr=xr, vc=1, wr=zr, wc=1; /* find the Kalman gain k: k = p h' /(h p h' + r) */ mat_mul_nt(p,pr,pc, h,hr,hc, num,nr,nc); mat_similarity(h,hr,hc, p,pr,pc, denom,dr,dc); mat_add(denom,dr,dc, r,rr,rc, denom,dr,dc); if (sym_factor(denom,dr,dc, denom,dr,dc)) return; /* failure - singular */ sym_rdiv(num,nr,nc, denom,dr,dc, k,kr,kc); /* update the state x: x <- x + k (z - h x) */ mat_mul(h,hr,hc, x,xr,1, w,wr,wc); mat_sub(z,zr,1, w,wr,wc, w,wr,wc); mat_mul(k,kr,kc, w,wr,wc, v,vr,vc); mat_add(x,xr,1, v,vr,vc, x,xr,1); /* update the covariance p: p <- (I - k h) p */ mat_one(v,xr,xr); mat_mul(k,kr,kc, h,hr,hc, w,xr,xr); mat_sub(v,xr,xr, w,xr,xr, w,xr,xr); mat_mul(w,xr,xr, p,xr,xr, v,xr,xr); mat_copy(v,xr,xr, p,xr,xr); } adjtimex-1.29/ChangeLog0000644000175000017500000005320111362175612013215 0ustar jrvjrv2010-04-16 James R. Van Zandt * Makefile.in (VERSION): version 1.29 * adjtimex.man: Document the --force-adjust option. 2010-04-15 James R. Van Zandt * adjtimex.c (compare): --force-adjust suppresses warning printouts. (compare): relax sanity check to +- 1 percent. 2009-11-07 James R. Van Zandt * Makefile.in (VERSION): version 1.28 * adjtimex.c (compare): Correctly apply +-500 ppm sanity check (Thanks to Jacques luder ) 2009-04-18 James R. Van Zandt * Makefile.in (VERSION): version 1.27.1 Add rules for running autoconf, autoheader, and ./configure. (adjtimex): Depend on Makefile, so it's recompiled if the version number changes. (SRC): include config.h.in * adjtimex.c (struct rtc_time): Provide workaround if linux/rtc.h is missing. * configure.in: Check for linux/rtc.h, but not limits.h (no longer used), sys/time.h, or unistd.h (there is no workaround implemented). 2009-03-22 James R. Van Zandt * Makefile.in (VERSION): version 1.27 * adjtimex.c (review): HELP is an enum instead of a #define. * adjtimex.c: Add some training calls to gettimeofday, so following calls will be more accurate (thanks to Alain Guibert ). 2009-03-14 James R. Van Zandt * adjtimex.c (review): Compute CMOS frequency error in PPM of CMOS time (thanks to Alain Guibert ). (review): Compute sys_time or the relative error between CMOS and sys_time in PPM of sys_time. 2009-03-14 Alain Guibert * adjtimex.c (compare, log_times): The first call to gettimeofday() in a process takes longer than usual, and the timestamp taken is a little bit late (up to 200 microseconds). Let's consume this bad call, so that the important timestamps are all coherant at the top of accuracy. * (log_times): We don't need the kernel's internal timezone. Let's stop requesting it. 2009-03-11 James R. Van Zandt * adjtimex.8: Document --force-adjust option. * adjtimex.c (longopt): --force-adjust overrides +-500 ppm sanity check. verbose is now a counter, -V increases verbosity. Require more than one option for several printouts. Print invalid option characters. If stating local time, explicitly say with or without summertime adjustment. 2009-03-10 James R. Van Zandt * adjtimex.c (cmos_read_time): use select() instead of a timer to avoid blocking even if /dev/rtc never becomes readable. (That code was misplaced at some point in the last year.) If using update interrupt, sanity check the delay. Sometimes the status includes an update complete flag, but it actually didn't wait. Fall back to another method of reading RTC. 2008-08-17 James R. Van Zandt * Makefile.in (VERSION): Write ISO8601 format data to .lsm file. Include commands to build Makefile (i.e. ./configure). version 1.26 * adjtimex.c (cmos_read_time): Fix a possible hang with the Intersil ISL1208, one of those new non-PC-compatible RTCs. Cleanly exits with an error message, instead of either hang or returning garbage. (Thanks to Alain Guibert). * adjtimex.lsm.in: Revise description, update file size. 2008-08-07 James R. Van Zandt * Makefile.in (VERSION): version 1.25 * adjtimex.8: document new --nointerrupt option 2008-08-07 James R. Van Zandt * adjtimex.8: Kernels through 2.6 are still using the same adjtimex status values. Mention new /dev file names. * adjtimex.c (cmos_init): try alternate ia64 and devfs device names (courtesy of hwclock sources). * adjtimex.c (cmos_read_time): Set an alarm to avoid blocking even if /dev/rtc never becomes readable, then fall back to busywait_second_change(). New --nointerrupt option to force busywait without waiting for the interrupt timeout (thanks to Alain Guibert). 2008-04-04 James R. Van Zandt * Makefile (VERSION): version 1.24 * adjtimex.c: Reorganize cmos_read_time() to properly integrate the fallback case for when /dev/rtc has no interrupts. Make this fallback actually work. fixes partially(?) Debian bug #460065 as by proposed solution #1 (Thanks to Alain Guibert ) (closes:Bug#471203) (cmos_read_time): Fix Y2K bug: read century from byte 50, instead of assuming we're in the range 1969-2068. (busywait_second_change) When /dev/rtc interrupt is not available, fallbacks to loops around ioctl(RTC_RD_TIME) until the RTC second changes. Patch applies to adjtimex 1.23 above first no-interrupt-fallback.patch fixes partially(?) Debian bug #460065 as by proposed solution #3 (Thanks to: Alain Guibert ) (cmos_read_time) If /dev/rtc does not exist then automatically fallback to /dev/rtc0, so it works even without symlink. (Thanks to: Alain Guibert ) 2008-04-03 James R. Van Zandt * adjtimex.c (main): fix typo in options handling (thanks to Miroslav Lichvar ) 2008-02-07 James R. Van Zandt * adjtimex.c (log_times): Convert some fprintf writes to perror, add "adjtimex: " to several perror messages. 2008-02-01 James R. Van Zandt * adjtimex.c: (cmos_read_time): use select() to avoid blocking even if /dev/rtc never becomes readable. 2007-10-06 James R. Van Zandt * Makefile.in (VERSION): version 1.23 * adjtimex.c (cmos_read_time): rename dummy to interrupt_info now that this read() value is actually used. (thanks to Alain Guibert ) * README: Rewrite USAGE paragraph. Remove point about creating zero adjfile. Document new behaviour without adjfile. Remove reference to the long outdated clock(8). Update URL for hwclock(8). (Thanks to Alain Guibert ) * adjtimex.c (cmos_read_time): The day-of-week value in the RTC free cycles from 1 to 7. This number is not synced with other RTC date values, but is only simply incremented at midnight. The day meant is in the eye of the reader, which nearly always just ignores the value. Most common assumption is that 1 means Sunday. (Thanks to Alain Guibert ) * adjtimex.c (compare): In case of absence of /etc/adjtime, do not fail, and do not force users to manually create it with 0.0 content. Instead, proceed assuming zero values (meaning RTC does not drift). Also replace redundant code by a call to get_cmos_adjustment(). (Thanks to Alain Guibert 2007-10-05 James R. Van Zandt * adjtimex.c (busy_wait): timestamp more closely the RTC clock beat (thanks to Alain Guibert , see Debian bug#443814). (usage): --directisa switch forces adjtimex to poll the update-in-process (UIP) flag of the CMOS clock (thanks to Alain Guibert , see Debian bug#443773). 2007-09-23 James R. Van Zandt * adjtimex.c (log_times): fix these bugs in ntpdate output interpretation (per Debian bug#438718): adjtimex has a bug in evaluating the output of ntpdate, because 1. it assumes ntpdate outputs "adjust time server", but ntpdate may output "step time server" also 2. it doesnt stop at last line but as soon as it has found "filter offset:" lines, and because of this it will not find the "offset ..." information in the last line. 2006-10-07 James R. Van Zandt * adjtimex.c: don't declare adjtimex syscall (should already be getting the declaration from sys/timex.h) 2006-05-27 James R. Van Zandt * adjtimex.c (log_times): Permit ntpdate to contact any number of time servers. (log_times): add -q to ntpdate command line (puthackent): with --verbose, display log entry and path to log file. (valid_system_rate, valid_cmos_rate): in messages, ask about /sbin/hwclock rather than the old /sbin/clock. (probe_time): If call to adjtimex fails, quit with error message. (Need root priv.) Thus, "adjtimex -r" and "adjtimex -c" fail rather than succeeding with bogus results. 2006-05-26 James R. Van Zandt * adjtimex.c (log_times): use stat to look for ntpdate in /usr/bin, /bin, /usr/sbin and /sbin. Close pipe with pclose instead of fclose. * adjtimex.8: express PLL time constant in terms of a power of two rather than the more obscure 1< * adjtimex.c (log_times): Eliminate compare_cmos_sys(), call cmos_read_time() instead. 2006-05-24 James R. Van Zandt * adjtimex.c (review): For both CMOS and system clocks, write suggested and current adjustments on a separate line from the estimated error in ppm. (cmos_read_time): Move the sanity check code (to adjust CMOS time by multiples of one hour) and code to read sytem time into this function. 2006-05-23 James R. Van Zandt * adjtimex.c (compare_cmos_sys): delete code to find UTC time via switching TZ (was controlled by ZONESWITCH, which was not #defined). * adjtimex.8: -h specifies the host, so it can't also ask for the help printout. -V or --verbose increases verbosity. Shifting CMOS time by up to 13 hours. 2006-05-23 James R. Van Zandt * adjtimex.c (cmos_read_time): set tm_isdst to -1 to signal that summer time information is not available (/dev/rtc doesn't set it) 2006-05-22 James R. Van Zandt * adjtimex.c (cmos_read_time): adjust month, day of week, and year only if reading from /dev/port. * Makefile (VERSION): version 1.21 * adjtimex.c (compare): Adjust CMOS times by + or - 60 min, if that brings them closer to the system time. If they still differ by more than 6 min, then print a warning and suppress logging. (Thanks to Alain Guibert for noting that summer time start/end can impact the log.) 2006-05-21 James R. Van Zandt * ChangeLog: Fix spelling of name Alain Guibert (sorry :-) * adjtimex.c (cmos_read_time): use /dev/rtc interface if possible (thanks to Richard Henderson ). 2005-09-05 James R. Van Zandt * README: fix email address 2004-09-19 James R. Van Zandt * Makefile.in (VERSION): version 1.20 * adjtimex.c (compare): in "compare" or "adjust", return immediately after printing last result (instead of sleeping an extra $interval seconds) (Thanks to Alain Guibert ) 2004-09-11 James R. Van Zandt * Makefile.in (VERSION): version 1.19 * adjtimex.c (compare): Account for the current frequency value when calculating the recommended frequency value. Simplify calculation of recommended tick. (compare): print estimated system clock error in ppm instead of obscure "second diff". * adjtimex.8: use 2^16 instead of the more obscure 1<<16. * adjtimex.c: revert to poll-wait instead of using /dev/rtc, because the latter only provides time with one second precision. 2004-04-11 James R. Van Zandt * Makefile.in (VERSION): version 1.18 * Makefile.in (install): create manual directory if necessary * adjtimex.c (usage): Don't split strings across lines. (main): --reset switch enables resetting of status (no longer default action, because it's not needed by recent kernels) (thanks to Alain Guibert ) 2004-04-09 James R. Van Zandt * adjtimex.c (longopt): --status switch sets clock status (courtesy of Alain Guibert 2004-04-04 James R. Van Zandt * Makefile.in (CFLAGS): add compiler switch -Wall (mandir): put man pages in $(prefix)/share/man/man8 2004-04-03 James R. Van Zandt * Makefile.in (VERSION): version 1.17 * adjtimex.c: update email (main): If adjtimex() returns an error, print HZ and legal ranges for tick and freq. (thanks to Sami Farin ) (review): calculate reasonable tick and frequency when HZ != 100. (cmos_init): use /dev/rtc when available (thanks to Richard Henderson * adjtimex.c (longopt): fix spelling to match documentation: --esterror and --maxerror (thanks to Alain Guibert) 2003-08-24 James R. Van Zandt * Makefile.in (VERSION): version 1.16 * adjtimex.c (main): added optstring, so options can be single letters again. 2003-05-31 James R. Van Zandt * adjtimex.c (usage): Escape the embedded newlines in the help message, and add explicit ones. (gcc 3.3 complains otherwise) 2003-04-30 James R. Van Zandt * Makefile.in (VERSION): version 1.15 * adjtimex.c: for ia64, call adjtimex instead of using syscall 2003-04-27 James R. Van Zandt * adjtimex.8: Compare the roles of ntpd, hwclock, and adjtimex. Fix case: -T (not -t) to set PLL time constant (thanks to Sanjoy Mahajan 2002-01-06 James R. Van Zandt * adjtimex.c (cmos_init): don't re-open the FD if it's already open (thanks to Jonathan H N Chin ) 2001-06-15 James R. Van Zandt * Makefile.in (VERSION): version 1.12.1 * README.ru: added Russian translation, courtesy of Alex Savvin 2000-12-02 James R. Van Zandt * adjtimex.c (valid_cmos_rate): Fix grammar in message. 2000-11-21 James R. Van Zandt * Makefile.in (VERSION): version 1.12 * adjtimex.c (puthackent): clear lfile after closing file, so it does not get closed a second time (thanks to Bjorn Eriksson ). 2000-05-14 James R. Van Zandt * Makefile.in (VERSION): version 1.11 * adjtimex.c (review): With both --review and --adjust, set sytem time parameters to the least-squares estimates. 2000-01-31 James R. Van Zandt * Makefile.in (VERSION): version 1.10 * adjtimex.c: #define _GNU_SOURCE so strptime is available * (log_times): use popen() to recover output from ntpdate, instead of an unsafe temporary file (thanks to Colin Phipps ) 2000-01-03 James R. Van Zandt * Makefile.in (VERSION): version 1.9 * adjtimex.c (usage): remove invalid entries -? and -h * adjtimex.c (main): Get version from -D flag rather than RCS string. * Makefile.in (adjtimex): Pass version in -D flag. * adjtimex.c (compare): Y2K fixes (okay until 2070) 1999-12-16 James R. Van Zandt * Makefile.in (adjtimex.lsm): make adjtimex.lsm from adjtimex.lsm.in (so version number gets entered automatically). * adjtimex.c (valid_system_rate): refer to ntpd instead of xntpd * adjtimex.8: refer to ntpd instead of xntpd * README: refer to ntpd instead of xntpd 1999-09-06 James R. Van Zandt * Makefile.in (bindir): executable goes into /sbin, so it's available even if /usr is in a separate filesystem. Removed unused variables DISTFILES and MISC. * (VERSION): 1.8 (setting here rather than using RCS version number of adjtimex.c) 1998-11-28 James R. Van Zandt * adjtimex.c: Don't use syscall1() to declare adjtimex() for Alpha. Courtesy of Paul Slootman 1998-10-24 James R. Van Zandt * adjtimex.8: change references: clock -> hwclock 1998-08-22 root * adjtimex.c (gethackent): Create log file if it does not exist. 1998-08-18 James R. Van Zandt * adjtimex.8: default log file is "/var/log/clocks.log". 1998-04-20 James R. Van Zandt * adjtimex.c: Code cleanups to silence warnings: Added some casts. Removed unused variables. Added parens around assignments inside tests. Code is now covered by GNU GPL. 1997-12-11 James R. Van Zandt * adjtimex.c: Scanning wtmp rather than utmp, looking for clock resets and reboots. Storing log file entry in a struct hack_s. --compare-all or -C logs values of both clocks and a reference time: compare3(). --watch asks user for reference time. -h consults specified host for reference time (partial implementation). valid_system_rate() determines whether we can estimate system clock rate from previous inverval. valid_cmos_rate() determines whether we can estimate cmos clock rate from previous interval. cmos_adj() fetches cmos adjustment from config file. compare_cmos_sys() compares the times on the two clocks, using enhanced real time clock support (/proc/rtc) if not root. LOG_PATH, WTMP_PATH, and ADJPATH introduced. added mkgmtime() which is like mktime() but assumes it's given UTC. Removed old code which changes the TZ environment variable. --host uses ntpdate to call timeserver. Implemented puthackent(). Filling out struct hack, calling puthackent() to write it. valid_system_time() checks /etc/adjtime too. valid_*() used getch() to read single character -- won't work with buffered reads. Switched to fgets(). Using /proc/rtc if available and not root. review() calculates adjustments from log entries. uses kalman_update(), which uses matrix routines from mat.c. --compare-all renamed to --log. --log can be used with --compare. compare3() renamed to log_times(). hack.tref (log time) renamed to hack.log. Log time is taken from system time, or even cmos time, if reference time is not available. No longer printing sys_error header an extra time. An uncertainty is printed with two significant digits if the first digit is `1', and one significant digit otherwise. Optional arguments on --log and --review switches sets the log path Making no adjustment recommendations unless uncertainty is < 100 ppm. Caveating uncertainty of least-squares solution. Including string.h rather than strings.h Really implementing --version switch Displaying more informative help message Credit Michael Meskes. Error sends short message to stderr. Usage message reworded. 1997-11-26 James R. Van Zandt * adjtimex.c: Credit Michael Meskes. Error sends short message to stderr. Usage message reworded. 1997-11-25 James R. Van Zandt * adjtimex.c: Including string.h rather than strings.h Really implementing --version switch Displaying more informative help message * adjtimex.c: An uncertainty is printed with two significant digits if the first digit is `1', and one significant digit otherwise. Optional arguments on --log and --review switches sets the log path Making no adjustment recommendations unless uncertainty is < 100 ppm. Caveating uncertainty of least-squares solution. 1997-09-13 James R. Van Zandt * adjtimex.c: --compare-all renamed to --log. --log can be used with --compare. compare3() renamed to log_times(). hack.tref (log time) renamed to hack.log. Log time is taken from system time, or even cmos time, if reference time is not available. No longer printing sys_error header an extra time. 1997-09-01 James R. Van Zandt * adjtimex.c: LOG_PATH, WTMP_PATH, and ADJPATH introduced. added mkgmtime() which is like mktime() but assumes it's given UTC. Removed old code which changes the TZ environment variable. --host uses ntpdate to call timeserver. Implemented puthackent(). Filling out struct hack, calling puthackent() to write it. valid_system_time() checks /etc/adjtime too. valid_*() used getch() to read single character -- won't work with buffered reads. Switched to fgets(). Using /proc/rtc if available and not root. review() calculates adjustments from log entries. uses kalman_update(), which uses matrix routines from mat.c. 1997-08-21 James R. Van Zandt * adjtimex.c: Scanning wtmp rather than utmp, looking for clock resets and reboots. Storing log file entry in a struct hack_s. --compare-all or -C logs values of both clocks and a reference time: compare3(). --watch asks user for reference time. -h consults specified host for reference time (partial implementation). valid_system_rate() determines whether we can estimate system clock rate from previous inverval. valid_cmos_rate() determines whether we can estimate cmos clock rate from previous interval. cmos_adj() fetches cmos adjustment from config file. compare_cmos_sys() compares the times on the two clocks, using enhanced real time clock support (/proc/rtc) if not root. 1997-02-28 James R. Van Zandt Added --help and --version switches. 1997-02-25 James R. Van Zandt put settimeofday() stuff in separate function, called twice. Incorporated clockdiff functions into adjtimex, as the "--comparing" and "--adjusting" options. (Thanks to Michael Meskes for the idea -- he implemented this functionality in the configuration script of his Debian package.) Repeat count set by "--count", and interval set by "--interval". Parsing command line options with getopt_long_only(). Test for "-singleshot" had broken "-offset" option. 1997-02-21 James R. Van Zandt Removed "status" setting option. Checking that ADJ_OFFSET_SINGLESHOT is not used with any other option. Label "time" -> "raw time". Ensuring kernel resets its internal status to TIME_BAD by calling settimeofday(). 1995-03-15 James R. Van Zandt Moved documentation to README file and man page. Ran through indent. Usage msg only shows "print" once. 1995-03-07 James R. Van Zandt Initial revision