If you add the following to the /src/include/port/darwin.h file,
pgsql-7.4 will build successfully on Darwin x86:
#define __darwin__ 1
#if defined(__ppc__)
#define HAS_TEST_AND_SET
#endif
+#if defined(__i386__)
+#define HAS_TEST_AND_SET
+#endif
#if defined(__ppc__)
typedef unsigned int slock_t;
#else
typedef unsigned char slock_t;
#endif