Hi Helmut,
I noticed that inn2 fails to cross build from source. It attempts to
check for sqlite3, but in doing so uses AC_RUN_IFELSE without a cross
compilation argument. Thus configure stops.
Other uses of AC_RUN_IFELSE indeed have a third argument, defaulting to
the lack of the tested capability (like mmap, a working inet_ntoa or
snprintf functions, etc.).
I looked into sqlite3 and it provides its version both as a macro and as
a function. This separation exists intentionally such that you may at
runtime check the version of the sqlite3 library rather than the one
used at build time. Since this check happens at build time, I argue that
the header version is as good as the runtime version. Using it enables
us to use AC_COMPUTE_INT and that happens to be compatible with cross
compilation. I thus propose the attached patch. Is that an acceptable
way forward?
Thanks for the patch! Looks good to me.
I have only added an extra check that $_INN_LIB_SQLITE3_VERSION is
defined because otherwise, if sqlite3 is not installed on the system,
the configure output is broken:
checking for a sufficiently recent SQLite... ./configure: line 30596:
test: : integer expression expected
no
Patch committed upstream:
https://github.com/InterNetNews/inn/commit/72dfe4688f6ab5d79e0f970bfdaf1e2f455d49cd
I have also added a comment to remember why we do not use the stock
version from rra-c-util
<https://github.com/rra/rra-c-util/blob/main/m4/sqlite3.m4>:
+dnl Checks if SQLite v3 is present. The single argument, if "true", says to
+dnl fail if the SQLite library could not be found. We do not use pkg-config
+dnl like the upstream version of this file as we have a specific check to
+dnl ensure that SQLite v3 meets our minimum version requirement.
--
Julien ÉLIE
« Audentes fortunat iuvat. » (Virgile)