--- config/cf/darwin.cf.orig	2005-05-01 21:23:32.000000000 -0700
+++ config/cf/darwin.cf	2005-05-01 21:26:15.000000000 -0700
@@ -29,6 +29,16 @@
 #define HasBSD44Sockets         YES
 #define Malloc0ReturnsNull      NO
 #define HasShadowPasswd         NO
+#if OSMajorVersion >= 7
+#define HasPam			YES
+#ifndef PamLibraries
+#define PamLibraries            -lpam
+#endif
+
+#ifndef PamMiscLibraries
+#define PamMiscLibraries        -lpam_misc
+#endif
+#endif
 #define HasUsableFileMmap       YES
 #define HasZlib                 YES
 #ifndef HasShm
@@ -154,23 +164,30 @@
 #define HasFlex                 YES
 
 /*
- * Our cpp isn't in /lib/cpp and early versions don't like -undef.
- * The gcc 3.3 cpp that Apple ships inserts spurious #pragmas,
- * so we use the 3.1-based version in this case.
+ * we support gcc 3.3 and 4.0 as the default compiler
  */
 #if (GccMajorVersion == 3) && (GccMinorVersion == 3)
-# define CppCmd                 /usr/bin/cpp3
+# define CppCmd                 /usr/bin/cpp-3.3
+# define StandardCppOptions	-traditional -P -D__GNUC__
+# define RawCppCmd              CppCmd -undef
+#define CppSedMagic sed -e '/^#  *[0-9][0-9]*  *.*$$/d' \
+			-e '/^#line  *[0-9][0-9]*  *.*$$/d' \
+			-e '/# *pragma /d' \
+			-e '/^[ 	]*XCOMM$$/s/XCOMM/#/' \
+			-e '/^[ 	]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/#/' \
+			-e '/^[ 	]*XHASH/s/XHASH/#/' \
+			-e '/\@\@$$/s/\@\@$$/\\/'
 #else
-# define CppCmd                 /usr/bin/cpp
-#endif
-#if (GccMajorVersion == 3) && (GccMinorVersion == 3) || (GccMajorVersion > 3)
-# define StandardCppOptions	-traditional -D__GNUC__
-#endif
-#if HasGcc3
+#if (GccMajorVersion > 3)
+# define CppCmd                 /usr/bin/cpp-4.0
+# define StandardCppOptions	-traditional -P -D__GNUC__
 # define RawCppCmd              CppCmd -undef
 #else
+# define CppCmd                 /usr/bin/cpp
+# define StandardCppOptions     -traditional -D__GNUC__
 # define RawCppCmd              CppCmd
 #endif
+#endif
 
 /* we have a gcc compatible compiler, but its not called gcc */
 #define CcCmd                   /usr/bin/cc
@@ -275,6 +292,10 @@
 
 #define BuildLibPathVar         DYLD_LIBRARY_PATH
 
+#define DefaultUserPath         /bin:/sbin:/usr/bin:/usr/sbin:$(BINDIR)
+#define DefaultSystemPath       DefaultUserPath
+
+
 /* include rules to build shared libraries */
 #include <darwinLib.rules>
 
