diff options
author | James Peach <jpeach@samba.org> | 2006-10-24 03:23:19 +0000 |
---|---|---|
committer | James Peach <jpeach@samba.org> | 2006-10-24 03:23:19 +0000 |
commit | a467b445491c41b1123872c33d1f7ddf424371e9 (patch) | |
tree | 9ed038b0f02999f5835000e481725784071b1886 /source/configure.in | |
parent | 67831c160daf306c05f5bd64b717d34f65a16f9b (diff) | |
download | samba-a467b445491c41b1123872c33d1f7ddf424371e9.tar.gz samba-a467b445491c41b1123872c33d1f7ddf424371e9.tar.xz samba-a467b445491c41b1123872c33d1f7ddf424371e9.zip |
r19477: Patch from Huang Dejin Eugene <hdejin@yahoo.com>.
Add configure option --enable-fam so that FAM support can explicitly
be controlled at build time. Default behaviour is to autodetect.
Diffstat (limited to 'source/configure.in')
-rw-r--r-- | source/configure.in | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/source/configure.in b/source/configure.in index 652bd390eed..91d304f0f29 100644 --- a/source/configure.in +++ b/source/configure.in @@ -2501,32 +2501,40 @@ fi # Check if FAM notifications are available. For FAM info, see # http://oss.sgi.com/projects/fam/ # http://savannah.nongnu.org/projects/fam/ +AC_ARG_ENABLE(fam, +[ --enable-fam Turn on FAM support (default=auto)]) + +if test x$enable_fam != xno; then + AC_CHECK_HEADERS(fam.h, [samba_cv_HAVE_FAM_H=yes], [samba_cv_HAVE_FAM_H=no]) + if test x"$samba_cv_HAVE_FAM_H" = x"yes"; then + # On IRIX, libfam requires libC, but other FAM implementations + # might not need it. + AC_CHECK_LIB(fam, FAMOpen2, + [samba_cv_HAVE_LIBFAM=yes; samba_fam_libs="-lfam"], + [samba_cv_HAVE_LIBFAM=no]) + + if test x"$samba_cv_HAVE_LIBFAM" = x"no" ; then + samba_fam_xtra=-lC + AC_CHECK_LIB_EXT(fam, samba_fam_xtra, FAMOpen2, + [samba_cv_HAVE_LIBFAM=yes; samba_fam_libs="-lfam -lC"], + [samba_cv_HAVE_LIBFAM=no]) + unset samba_fam_xtra + fi + fi -AC_CHECK_HEADERS(fam.h, [samba_cv_HAVE_FAM_H=yes], [samba_cv_HAVE_FAM_H=no]) -if test x"$samba_cv_HAVE_FAM_H" = x"yes"; then - # On IRIX, libfam requires libC, but other FAM implementations might not - # need it. - AC_CHECK_LIB(fam, FAMOpen2, - [samba_cv_HAVE_LIBFAM=yes; samba_fam_libs="-lfam"], - [samba_cv_HAVE_LIBFAM=no]) - - if test x"$samba_cv_HAVE_LIBFAM" = x"no" ; then - samba_fam_xtra=-lC - AC_CHECK_LIB_EXT(fam, samba_fam_xtra, FAMOpen2, - [samba_cv_HAVE_LIBFAM=yes; samba_fam_libs="-lfam -lC"], - [samba_cv_HAVE_LIBFAM=no]) - unset samba_fam_xtra + if test x"$samba_cv_HAVE_LIBFAM" = x"yes" ; then + AC_DEFINE(HAVE_FAM_CHANGE_NOTIFY, 1, + [Whether FAM file notifications are available]) + AC_TRY_COMPILE([#include <fam.h>], + [FAMCodes code = FAMChanged;], + AC_DEFINE(HAVE_FAM_H_FAMCODES_TYPEDEF, 1, + [Whether fam.h contains a typedef for enum FAMCodes]), + []) fi -fi -if test x"$samba_cv_HAVE_LIBFAM" = x"yes" ; then - AC_DEFINE(HAVE_FAM_CHANGE_NOTIFY, 1, - [Whether FAM is file notifications are available]) - AC_TRY_COMPILE([#include <fam.h>], - [FAMCodes code = FAMChanged;], - AC_DEFINE(HAVE_FAM_H_FAMCODES_TYPEDEF, 1, - [Whether fam.h contains a typedef for enum FAMCodes]), - []) + if test x$enable_fam = xyes && test x"$samba_cv_HAVE_LIBFAM" != xyes ; then + AC_MSG_ERROR(FAM support requested but FAM library not available ) + fi fi ################################################# |