OS X has the PAM library, but only 10.6 has the headers, so check for those.  NOTE: a compiler check is forced because, when cross-compiling on 10.6 using the 10.5 or 10.4 SDK, the preprocessor will detect the headers in /usr/include, but the compiler can't compile them, since the SDK does not have those headers.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4149 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/configure.ac b/configure.ac
index 4ea0706..a5ebbff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,8 +87,10 @@
 AM_CONDITIONAL([HAVE_GNUTLS], [ ! test "x$GNUTLS_LIBS" = x ])
 
 AC_CHECK_LIB([pam], [pam_start], 
-	     [PAM_LIBS='-lpam'
-	      AC_DEFINE(HAVE_PAM, 1, [PAM available])])
+	     [AC_CHECK_HEADER([security/pam_appl.h],
+			     [PAM_LIBS='-lpam'
+			      AC_DEFINE(HAVE_PAM, 1, [PAM available])],
+			     [], [#include <stdio.h>])])
 AC_SUBST([PAM_LIBS])
 AM_CONDITIONAL([HAVE_PAM], [ ! test "x$PAM_LIBS" = x ])