Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / cf / solaris-renamepath.m4
CommitLineData
805e021f
CE
1dnl This checks for the existence of the vn_renamepath function, added in
2dnl Solaris 11 and Solaris 10u8.
3dnl
4dnl Just trying to use the function is not sufficient for a configure test,
5dnl since using an undeclared function is just a warning, and we want an error.
6dnl Rather than try to rely on making warnings generate errors (which may
7dnl change depending on what compiler version we're using, or in the future
8dnl different compilers entirely), we detect the function by declaring an
9dnl incompatible prototype. If that successfully compiles, vn_renamepath
10dnl does not exist in the system headers, so we know it's not there. If it
11dnl fails, we try to compile again without the incompatible prototype, to
12dnl make sure we didn't fail for some other reason. If that succeeds, we know
13dnl we have vn_renamepath available; if it fails, something else is wrong and
14dnl we just try to proceed, assuming we don't have it.
15dnl
16AC_DEFUN([SOLARIS_HAVE_VN_RENAMEPATH],
17
18 [AC_CACHE_CHECK([for vn_renamepath],
19 [ac_cv_solaris_have_vn_renamepath],
20 [AC_COMPILE_IFELSE(
21 [AC_LANG_PROGRAM(
22 [[#define _KERNEL
23 #include <sys/vnode.h>]],
24 [[void vn_renamepath(void);]])],
25 [ac_cv_solaris_have_vn_renamepath=no],
26 [AC_COMPILE_IFELSE(
27 [AC_LANG_PROGRAM(
28 [[#define _KERNEL
29 #include <sys/vnode.h>]])],
30 [ac_cv_solaris_have_vn_renamepath=yes],
31 [ac_cv_solaris_have_vn_renamepath=no])])])
32
33 AS_IF([test "x$ac_cv_solaris_have_vn_renamepath" = "xyes"],
34 [AC_DEFINE([HAVE_VN_RENAMEPATH], [1],
35 [define if the function vn_renamepath exists])])])