fix false negatives with periodic needles in strstr, wcsstr, and memmem

in cases where the memorized match range from the right factor
exceeded the length of the left factor, it was wrongly treated as a
mismatch rather than a match.

issue reported by Yves Bastide.

(cherry picked from commit 476cd1d96560aaf7f210319597556e7fbcd60469)
perform minimal sanity checks on zoneinfo files loaded via TZ variable

previously, setting TZ to the pathname of a file which was not a valid
zoneinfo file would usually cause programs using local time zone based
operations to crash. the new code checks the file size and magic at
the beginning of the file, which seems sufficient to prevent
accidental misconfiguration from causing crashes. attempting to make
fully-robust validation would be futile unless we wanted to drop use
of mmap (shared zoneinfo) and instead read it into a local buffer,
since such validation would be subject to race conditions with
modification of the file.

(cherry picked from commit c3d9d172b1fcd56c4d356798f4e3b4653076bcc3)
fix superh nofpu check on old gcc versions

As far as gcc3 knows, sh4 is the only processor version that can have an
FPU, so it indicates the FPU's presence by defining __SH4__.  This is not
defined if there is no FPU, even if the processor really is an SH4.

Starting with gcc4, there is support for the sh2a processor, which has an
FPU but is not an SH4.  gcc4 therefore additionally defines __SH_FPU_ANY__
when there is an FPU, but still doesn't define __SH4__ for an FPU-less sh4.

Therefore, to support all gcc versions, we must look at both preprocessor
symbols.

(cherry picked from commit 23d64182d8328c300b368446aad20da9cec91aa3)
fix missing SO_RCVBUFFORCE and SO_SNDBUFFORCE in mips socket.h

(cherry picked from commit 468bc11ed059c475f974920ac3d499e6071a6b2c)
remove useless __yield alias for sched_yield

this is no longer used for anything, and reportedly clashed with a
builtin on certain compilers.

(cherry picked from commit adbf0258be4eea5f012e173de7e55a87f3093669)
fix strftime %s not to zero pad with default width=2

(cherry picked from commit ac0acd569e01735fc6052d43fdf57f3a07c93f3d)
add configure check for working compiler

without this, broken choices of CC/CPPFLAGS/CFLAGS don't show up until
late in the configure process where they are confusingly reported as a
different failure such as incorrect long double type.

(cherry picked from commit 8945667fadc2eb71b7924bb4c5a69507fd362f4a)
add configure check for broken gcc 4.9.0 and possibly other versions

this is gcc bug #61144. the broken compiler is detected, but the user
must manually work around it. this is partly to avoid complex logic
for adding workaround CFLAGS and attempting to recheck with them, and
partly for the sake of letting the user know the compiler is broken
(since the workaround will result in less-efficient code production).

some refactoring was also needed to move the check for gcc outside of
the check for whether to build the compiler wrapper.

(cherry picked from commit 9ca4dae5d895cf816eb1815511aba77a90f6acd7)
fix unhandled cases in strptime

%C, %U, %W, and %y handling were completely missing; %C wrongly
fell-through to unrelated cases, and the rest returned failure. for
now, they all parse numbers in the proper forms and range-check the
values, but they do not store the value anywhere.

it's not clear to me whether, as "derived" fields, %U and %W should
produce any result. they certainly cannot produce a result unless the
year and weekday are also converted, but in this case it might be
desirable for them to do so. clarification is needed on the intended
behavior of strptime in cases like this.

%C and %y have well-defined behavior as long as they are used together
(and %y is defined by itself but may change in the future).
implementing them (including their correct interaction) is left as a
later change to be made.

finally, strptime now rejects unknown/invalid format characters
instead of ignoring them.

(cherry picked from commit dec66750b8ed4493d5bb40042f7a473e60fe934e)
trivial formatting fix for the config.mak generated by configure

(cherry picked from commit 7c6db373a55a348b3ecc7b124dd4ea541eff63cd)
release 1.0.2