s3: PAM_RHOST and PAM_TTY are enums on FreeBSD
[nivanova/samba.git] / source3 / configure.in
index b4564eec0831015044761b9755f75fa2b86d87f4..02904800a35c78c7890a58c59c0987cc14bbe1bd 100644 (file)
@@ -210,6 +210,10 @@ AC_SAMBA_GNU_MAKE([true], [true])
 m4_include(../m4/check_perl.m4)
 AC_SAMBA_PERL([true], [merged_build_possible=no])
 
+# Check for python
+m4_include(../m4/check_python.m4)
+AC_SAMBA_PYTHON_DEVEL([true], [merged_build_possible=no])
+
 AC_CHECK_TOOL(AR, ar)
 
 dnl Check if we (actually our C compiler!) use GNU ld
@@ -339,7 +343,7 @@ AC_CACHE_CHECK([that the C compiler understands negative enum values],samba_cv_C
                return 0;
        }
 ],
-       samba_cv_CC_NEGATIVE_ENUM_VALUES=yes,samba_cv__CC_NEGATIVE_ENUM_VALUES=no)])
+       samba_cv_CC_NEGATIVE_ENUM_VALUES=yes,samba_cv_CC_NEGATIVE_ENUM_VALUES=no)])
 if test x"$samba_cv_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then
        AC_MSG_WARN([using --uint-enums for pidl])
        PIDL_ARGS="$PIDL_ARGS --uint-enums"
@@ -4582,6 +4586,29 @@ if test x"${try_pam}" != x"no";then
 
        AC_MSG_CHECKING(whether to have PAM MODULES support)
        AC_MSG_RESULT([$create_pam_modules])
+
+       AC_TRY_COMPILE([
+               #if defined(HAVE_SECURITY_PAM_APPL_H)
+               #include <security/pam_appl.h>
+               #elif defined(HAVE_PAM_PAM_APPL_H)
+               #include <pam/pam_appl.h>
+               #endif],[
+               pam_set_item(0, PAM_RHOST, 0);
+               ],
+               AC_DEFINE(HAVE_PAM_RHOST, 1,
+                         [Define to 1 if PAM_RHOST is available]),[])
+
+       AC_TRY_COMPILE([
+               #if defined(HAVE_SECURITY_PAM_APPL_H)
+               #include <security/pam_appl.h>
+               #elif defined(HAVE_PAM_PAM_APPL_H)
+               #include <pam/pam_appl.h>
+               #endif],[
+               pam_set_item(0, PAM_TTY, 0);
+               ],
+               AC_DEFINE(HAVE_PAM_TTY, 1,
+                         [Define to 1 if PAM_TTY is available]),[])
+
 fi # try_pam != no
 
 #################################################
@@ -6506,7 +6533,9 @@ AC_SUBST(FLAGS1)
 ###################################################
 # Check for different/missing (set|get|end)netgrent prototypes
 CFLAGS_SAVE=$CFLAGS
-CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
+if test x"$samba_cv_HAVE_Wdeclaration_after_statement" = x"yes"; then
+       CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
+fi
 AC_CACHE_CHECK([for setnetgrent prototype],samba_cv_setnetgrent_prototype, [
     AC_TRY_COMPILE([#include<netdb.h>
                     #ifdef HAVE_NETGROUP_H
@@ -6834,9 +6863,6 @@ fi
 m4_include(../lib/zlib/zlib.m4)
 
 if test x$enable_merged_build = xauto; then
-       # Check for python
-       m4_include(../m4/check_python.m4)
-       AC_SAMBA_PYTHON_DEVEL([true], [merged_build_possible=no])
 
        AC_MSG_CHECKING([whether it would be possible to do a merged build])
        AC_MSG_RESULT([$merged_build_possible])