s3-waf: add pam configure checks.
authorGünther Deschner <gd@samba.org>
Wed, 1 Dec 2010 20:26:49 +0000 (21:26 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 6 Dec 2010 16:34:45 +0000 (17:34 +0100)
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Mon Dec  6 17:34:45 CET 2010 on sn-devel-104

source3/wscript

index 3354ec16c1ca75d24e5cee20e83c97e62310d624..b91c6fa41da37574353813b1231a158584a168ec 100644 (file)
@@ -743,8 +743,75 @@ return krb5_kt_resolve(context, "WRFILE:api", &keytab);
             conf.DEFINE('HAVE_ICONV', 1)
 
     if Options.options.with_pam:
-        conf.CHECK_HEADERS('security/pam_appl.h security/pam_modules.h pam/pam_modules.h', together=True)
-        conf.CHECK_FUNCS_IN('pam_start', 'pam', checklibc=True, headers='security/pam_appl.h')
+        conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
+        if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
+            print "--with-pam=yes but pam_appl.h not found"
+            sys.exit(1)
+        conf.CHECK_FUNCS_IN('pam_get_data', 'pam', mandatory=True)
+       conf.CHECK_HEADERS('security/pam_modules.h pam/pam_modules.h')
+       if not conf.CONFIG_SET('HAVE_SECURITY_PAM_MODULES_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_MODULES_H'):
+            print "--with-pam=yes but pam_modules.h not found"
+            sys.exit(1)
+        conf.CHECK_HEADERS('security/pam_ext.h security/_pam_macros.h')
+        conf.CHECK_HEADERS('pam/pam_ext.h pam/_pam_macros.h')
+        conf.CHECK_FUNCS_IN('pam_vsyslog', 'pam')
+       conf.CHECK_CODE('''
+#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);
+''',
+            'HAVE_PAM_RHOST',
+            lib='pam',
+            msg="Checking whether PAM_RHOST is available");
+       conf.CHECK_CODE('''
+#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);
+''',
+            'HAVE_PAM_TTY',
+            lib='pam',
+            msg="Checking whether PAM_TTY is available");
+       conf.CHECK_CODE('''
+#if (!defined(LINUX))
+
+#define PAM_EXTERN extern
+#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
+
+#endif
+
+#if defined(HAVE_SECURITY_PAM_MODULES_H)
+#include <security/pam_modules.h>
+#elif defined(HAVE_PAM_PAM_MODULES_H)
+#include <pam/pam_modules.h>
+#endif
+
+#if defined(HAVE_SECURITY__PAM_MACROS_H)
+#include <security/_pam_macros.h>
+#elif defined(HAVE_PAM__PAM_MACROS_H)
+#include <pam/_pam_macros.h>
+#endif
+
+#ifdef HAVE_SECURITY_PAM_EXT_H
+#include <security/pam_ext.h>
+#endif
+
+int i; i = PAM_RADIO_TYPE;
+''',
+            'HAVE_PAM_RADIO_TYPE',
+            lib='pam',
+            msg="Checking whether PAM_RADIO_TYPE is available");
+        conf.DEFINE('WITH_PAM', 1)
+        conf.DEFINE('WITH_PAM_MODULES', 1)
 
     seteuid = False
     if not seteuid: