Compilation updates
diff --git a/ChangeLog b/ChangeLog
index b585c25..307fe3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Wed Oct  6 02:00:33 CEST 1999 Wichert Akkerman <wakkerma@debian.org>
+
+  * Update cvsbuild to give a better error if autoconf isn't installed
+  * Add test for linux/ptrace.h to configure
+  * Since we define GNU_SOURCE in the Makefile we don't need to define
+    USE_GNU in file.c anymore
+
+Fri Sep 10 04:35:16 CEST 1999 Wichert Akkerman <wakkerma@debian.org>
+
+  * #define USE_GNU before including file.c so we get some extra O_* flags
+
+Tue Aug 31 16:27:21 CEST 1999 Wichert Akkerman <wakkerma@debian.org>
+
+  * Add missing } in IPv6 output
+
 Tue Aug 31 01:23:08 CEST 1999  Wichert Akkerman <wakkerma@debian.org>
 
   * Update copyright for strace-graph to BSD to be consistent with
diff --git a/configure.in b/configure.in
index 41e821a..ab0e724 100644
--- a/configure.in
+++ b/configure.in
@@ -126,7 +126,7 @@
 AC_SIG_ATOMIC_T
 AC_CHECK_LIB(nsl, main)
 AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop)
-AC_CHECK_HEADERS(sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h sys/stream.h sys/tiuser.h sys/sysconfig.h asm/sigcontext.h ioctls.h sys/ioctl.h sys/ptrace.h termio.h)
+AC_CHECK_HEADERS(sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h sys/stream.h sys/tiuser.h sys/sysconfig.h asm/sigcontext.h ioctls.h sys/ioctl.h sys/ptrace.h termio.h linux/ptrace.h asm/reg.h)
 AC_DECL_SYS_ERRLIST
 AC_DECL_SYS_SIGLIST
 AC_DECL__SYS_SIGLIST
diff --git a/cvsbuild b/cvsbuild
index d6e6e9d..a441501 100755
--- a/cvsbuild
+++ b/cvsbuild
@@ -1,5 +1,21 @@
 #! /bin/sh
 
+PROJECT=strace
+
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have autoconf installed to compile $PROJECT."
+	echo "Download the appropriate package for your distribution,"
+	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+	DIE=1
+}
+
+if test "$DIE" -eq 1; then
+    exit 1
+fi
+
 autoheader
 autoconf
 ./configure $@
diff --git a/net.c b/net.c
index d8e4b15..2026b64 100644
--- a/net.c
+++ b/net.c
@@ -352,7 +352,7 @@
 		{
 			tprintf("{sin6_family=AF_INET6, ");
 			inet_ntop(AF_INET6, &sa6.sin6_addr, string_addr, sizeof(string_addr));
-			tprintf("sin6_port=htons(%u), inet_pton(AF_INET6, \"%s\", &sin6_addr), sin6_flowinfo=htonl(%u)",
+			tprintf("sin6_port=htons(%u), inet_pton(AF_INET6, \"%s\", &sin6_addr), sin6_flowinfo=htonl(%u)}",
 				ntohs(sa6.sin6_port), string_addr, ntohl(sa6.sin6_flowinfo));
 		}
 		break;	
diff --git a/process.c b/process.c
index aa169de..9d09c8a 100644
--- a/process.c
+++ b/process.c
@@ -44,15 +44,20 @@
 #include <machine/reg.h>
 #endif /* SUNOS4 */
 
-#if defined(linux) && !defined(__GLIBC__)
+#if HAVE_LINUX_PTRACE_H
+#undef PTRACE_SYSCALL
 #include <linux/ptrace.h>
 #endif 
 
 #ifdef HAVE_SYS_REG_H
 # include <sys/reg.h>
+#ifndef PTRACE_PEEKUSR
 # define PTRACE_PEEKUSR PTRACE_PEEKUSER
+#endif
+#ifndef PTRACE_POKEUSR
 # define PTRACE_POKEUSR PTRACE_POKEUSER
 #endif
+#endif
 
 #ifdef LINUX
 #include <asm/posix_types.h>
diff --git a/signal.c b/signal.c
index d5f2336..3d4b7c1 100644
--- a/signal.c
+++ b/signal.c
@@ -39,15 +39,20 @@
 #include <sys/ucontext.h>
 #endif /* SVR4 */
 
-#if defined(linux) && !defined(__GLIBC__)
+#if HAVE_LINUX_PTRACE_H
+#undef PTRACE_SYSCALL
 #include <linux/ptrace.h>
 #endif 
 
 #ifdef HAVE_SYS_REG_H
 # include <sys/reg.h>
+#ifndef PTRACE_PEEKUSR
 # define PTRACE_PEEKUSR PTRACE_PEEKUSER
+#endif
+#ifndef PTRACE_POKEUSR
 # define PTRACE_POKEUSR PTRACE_POKEUSER
 #endif
+#endif
 
 #ifdef LINUX
 
diff --git a/syscall.c b/syscall.c
index 912a273..7c31fc0 100644
--- a/syscall.c
+++ b/syscall.c
@@ -38,19 +38,22 @@
 #include <sys/syscall.h>
 #include <sys/param.h>
 
-#if defined(LINUX) && defined(SPARC)
+#if HAVE_ASM_REG_H
 #include <asm/reg.h>
 #endif
 
-#ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
-# define PTRACE_PEEKUSR PTRACE_PEEKUSER
-#endif
-
-#if defined(linux) && !defined(__GLIBC__)
+#if HAVE_LINUX_PTRACE_H
+#undef PTRACE_SYSCALL
 #include <linux/ptrace.h>
 #endif 
 
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#ifndef PTRACE_PEEKUSR
+# define PTRACE_PEEKUSR PTRACE_PEEKUSER
+#endif
+#endif
+
 #ifndef SYS_ERRLIST_DECLARED
 extern int sys_nerr;
 extern char *sys_errlist[];
diff --git a/util.c b/util.c
index 7d9c5fa..41a8b3a 100644
--- a/util.c
+++ b/util.c
@@ -40,7 +40,7 @@
 #include <link.h>
 #endif /* SUNOS4 */
 
-#if defined(linux) && !defined(__GLIBC__)
+#if defined(linux)
 #include <linux/ptrace.h>
 #endif