Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure.ac: relax the check warning for gmtime_[rs] and localtime_[rs]… #2116

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

jimklimov
Copy link
Member

…as long as we have one, it is okay

Closes: #2115

@jimklimov jimklimov added enhancement packaging CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) portability We want NUT to build and run everywhere possible labels Oct 18, 2023
@jimklimov jimklimov added this to the 2.8.1 milestone Oct 18, 2023
As long as we have one, it is okay

Closes: networkupstools#2115

Signed-off-by: Jim Klimov <[email protected]>
@desertwitch
Copy link
Contributor

desertwitch commented Oct 18, 2023

I came up with a similar solution:

AC_CHECK_FUNCS(strtok_r fileno sigemptyset sigaction,
        [], [AC_MSG_WARN([Required C library routine not found; try adding -D_POSIX_C_SOURCE=200112L])])

AC_CHECK_FUNCS(localtime_r localtime_s)
if test "x${ac_cv_func_localtime_r}" != xyes && test "x${ac_cv_func_localtime_s}" != xyes; then
        AC_MSG_WARN([Required C library routine not found; try adding -D_POSIX_C_SOURCE=200112L])
fi

AC_CHECK_FUNCS(gmtime_r gmtime_s)
if test "x${ac_cv_func_gmtime_r}" != xyes && test "x${ac_cv_func_gmtime_s}" != xyes; then
        AC_MSG_WARN([Required C library routine not found; try adding -D_POSIX_C_SOURCE=200112L])
fi

But while I was figuring out how to sign off my commit you were faster.
... and I like your solution better - so I've since tested your PR and it builds nicely now. ;-)

@jimklimov
Copy link
Member Author

FYI: For just signing off, there is the -s argument (to commit, amend, rebase, etc.)

For more hassle about authored code provenance, see if https://github.com/networkupstools/nut/wiki/Code-contributions,-PRs,-PGP-and-DCO helps (welcome to amend if not) :)

@jimklimov jimklimov merged commit 0312643 into networkupstools:master Oct 18, 2023
@jimklimov jimklimov deleted the issue-2115 branch October 18, 2023 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) enhancement packaging portability We want NUT to build and run everywhere possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compiler warnings: localtime and gmtime
2 participants