]> git.proxmox.com Git - mirror_spl.git/commit - config/spl-build.m4
When checking for symbol exports, try compiling.
authorEtienne Dechamps <etienne.dechamps@ovh.net>
Mon, 16 Jul 2012 15:04:05 +0000 (17:04 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 26 Jul 2012 22:12:35 +0000 (15:12 -0700)
commit723aa3b0c2eed070f7eeadd2ce2d87f46da6d0f8
treebce6ca02d0958e427e0125452a3a0d5b8365feac
parentdf7cc5bc7111ab7cef6e89522685c6b8dd4bb95c
When checking for symbol exports, try compiling.

This patch adds a new autoconf function: SPL_LINUX_TRY_COMPILE_SYMBOL.
This new function does the following:

 - Call LINUX_TRY_COMPILE with the specified parameters.
 - If unsuccessful, return false.
 - If successful and we're configuring with --enable-linux-builtin,
   return true.
 - Else, call CHECK_SYMBOL_EXPORT with the specified parameters and
   return the result.

All calls to CHECK_SYMBOL_EXPORT are converted to
LINUX_TRY_COMPILE_SYMBOL so that the tests work even when configuring
for builtin on a kernel which doesn't have loadable module support, or
hasn't been built yet.

The only exception are:

 - AC_GET_VMALLOC_INFO, because we don't even have a public header to
include in the test case, but that's okay considering this symbol can
be ignored just fine.

- SPL_AC_DEVICE_CREATE, which is legacy API for 2.6.18 kernels.  Since
kernels this old are no longer supported it should arguably just be
removed entirely from the build system.

Note that we're also checking for the correct prototype with an actual
call, which was not the case with CHECK_SYMBOL_EXPORT. However, for
"complicated" test cases like with multiple symbol versions (e.g.
vfs_fsync), we stick with the original behavior and only check for the
function's existence.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue zfsonlinux/zfs#851
config/spl-build.m4
configure
spl_config.h.in