[Nut-upsdev] [nut-commits] buildbot failure in Network UPS Tools on FreeBSD-i686
Arjen de Korte
nut+devel at de-korte.org
Mon Jan 25 20:16:55 UTC 2010
Citeren Arnaud Quette <aquette.dev op gmail.com>:
> I'll have a look at it and get back with a suitable solution.
> the current situation is that, if we don't define _XOPEN_SOURCE (as
> it is currently with AC_CHECK_DECLS()), then strptime won't be
> available...
>
> so this test currently fails on my various Debian systems...
I noticed that some BuildBots didn't complain about this, even though
the strptime() function is not declared (see the config.log for
openSUSE for instance). That made me wonder if there might be
similarities between the ones complaining and the ones not
complaining. Lo and behold, I found one! The BuildBots that don't
complain, all have LIBNETSNMP_CFLAGS defined. Since the flags
accumulate, these will be used for compiling *all* sources. After
trying out a couple, it turns out that the -D_GNU_SOURCE enables the
declaration that is needed. After checking out some autoconf macro's I
think I found the right one:
--------
Macro: AC_USE_SYSTEM_EXTENSIONS
This macro was introduced in Autoconf 2.60. If possible, enable
extensions to C or Posix on hosts that normally disable the
extensions, typically due to standards-conformance namespace issues.
This should be called before any macros that run the C compiler. The
following preprocessor macros are defined where appropriate:
_GNU_SOURCE
Enable extensions on GNU/Linux.
__EXTENSIONS__
Enable general extensions on Solaris.
_POSIX_PTHREAD_SEMANTICS
Enable threading extensions on Solaris.
_TANDEM_SOURCE
Enable extensions for the HP NonStop platform.
_ALL_SOURCE
Enable extensions for AIX 3, and for Interix.
_POSIX_SOURCE
Enable Posix functions for Minix.
_POSIX_1_SOURCE
Enable additional Posix functions for Minix.
_MINIX
Identify Minix platform. This particular preprocessor macro
is obsolescent, and may be removed in a future release of Autoconf.
--------
I strongly feel that we should include this macro, in order to enable
POSIX compliance (which we heavily depend on throughout the codebase
already). As far as I can see, the only drawback would be that it ups
the requirements for Autoconf to 2.60. This might be a problem for
people that build from SVN on older systems. Mitigating factor is that
they could instead use the tarballs we provide on the BuildBot and
that we should make available through the website as well then. For
testing purposes, I added the above to configure.in, to see what
happens. All of our BuildBots run a compatible version of Autoconf, so
we don't shoot ourselves in the foot.
Any thoughts?
Best regards, Arjen
--
Please keep list traffic on the list
More information about the Nut-upsdev
mailing list