Include config.h, if we have it (HAVE_CONFIG_H).
Include <sys/types.h>.  HP-UX can't include pthread.h otherwise.
Replace test for UNW_TARGET_IA64 with test for HAVE_IA64INTRIN_H.

(Logical change 1.63)
diff --git a/include/internal.h b/include/internal.h
index 74ed5de..c4a90a6 100644
--- a/include/internal.h
+++ b/include/internal.h
@@ -26,8 +26,14 @@
 #ifndef internal_h
 #define internal_h
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 /* Platform-independent libunwind-internal declarations.  */
 
+#include <sys/types.h>	/* HP-UX needs this before include of pthread.h */
+
 #include <assert.h>
 #include <libunwind.h>
 #include <pthread.h>
@@ -84,7 +90,7 @@
 #define mutex_lock(l)	(pthread_mutex_lock ? pthread_mutex_lock (l) : 0)
 #define mutex_unlock(l)	(pthread_mutex_unlock ? pthread_mutex_unlock (l) : 0)
 
-#if UNW_TARGET_IA64
+#ifdef HAVE_IA64INTRIN_H
 # define HAVE_CMPXCHG
 # include <ia64intrin.h>
 # define cmpxchg_ptr(_ptr,_o,_n)					\