Remove parts of automake machinery which are not needed on Linux

This change is a verbatim part of Dmitry's changes to remove support
for non-Linux architectures.

* Makefile.am: Don't install PORTING file. Install README-linux-ptrace file.
Set OS variable to linux unconditionally.
* configure.ac: Remove code to set opsys variable, and its usage.
Remove checks for headers which are never present on Linux.
* m4/stat.m4: Remove 'ifdef LINUX' check.
* m4/statfs.m4: Likewise.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/Makefile.am b/Makefile.am
index 97cd43b..5ac0c9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,8 +6,7 @@
 man_MANS = strace.1
 bin_SCRIPTS = strace-graph
 
-# OS is `linux'
-OS		= @opsys@
+OS		= linux
 # ARCH is `i386', `m68k', `sparc', etc.
 ARCH		= @arch@
 
@@ -28,8 +27,8 @@
 	     debian/strace.docs debian/strace.examples debian/strace.install \
 	     debian/strace.manpages debian/strace-udeb.install \
 	     strace.spec \
-	     strace-graph ChangeLog ChangeLog-CVS COPYRIGHT CREDITS PORTING \
-	     README-linux \
+	     strace-graph ChangeLog ChangeLog-CVS COPYRIGHT CREDITS \
+	     README-linux README-linux-ptrace \
 	     linux/ioctlsort.c linux/ioctlent.sh \
 	     linux/ioctlent.h.in linux/errnoent.h linux/signalent.h \
 	     linux/syscall.h linux/dummy.h \
diff --git a/configure.ac b/configure.ac
index 6eb9a03..d1513ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,40 +8,6 @@
 AM_MAINTAINER_MODE
 AC_CANONICAL_HOST
 
-AC_MSG_CHECKING([for supported operating system])
-case "$host_os" in
-*linux*)
-	opsys=linux
-	AC_DEFINE([LINUX], 1, [Define for the Linux operating system.])
-	;;
-sunos4*)
-	opsys=sunos4
-	AC_DEFINE([SUNOS4], 1, [Define for the SunOS 4.x operating system.])
-	;;
-solaris2* | sysv[[45]]* | irix[[56]]*)
-	opsys=svr4
-	AC_DEFINE([SVR4], 1, [Define for the System V release 4 operating
-system or a derivative like Solaris 2.x or Irix 5.x.])
-	case "$host_os" in
-	sysv4.2uw*)
-		AC_DEFINE(UNIXWARE, 2, [Define for UnixWare systems.])
-		;;
-	sysv5*)
-		AC_DEFINE(UNIXWARE, 7, [Define for UnixWare systems.])
-		;;
-	esac
-	;;
-freebsd*)
-	opsys=freebsd
-	AC_DEFINE([FREEBSD], 1, [Define for the FreeBSD operating system.])
-	;;
-*)
-	AC_MSG_RESULT([NO!])
-	AC_MSG_ERROR([operating system $host_os is not supported by strace])
-	;;
-esac
-AC_MSG_RESULT($opsys)
-
 AC_MSG_CHECKING([for supported architecture])
 case "$host_cpu" in
 bfin)
@@ -138,10 +104,8 @@
 esac
 AC_MSG_RESULT($arch)
 
-AC_SUBST(opsys)
 AC_SUBST(arch)
 
-AM_CONDITIONAL([LINUX], [test x$opsys = xlinux])
 AM_CONDITIONAL([I386], [test x$arch = xi386])
 AM_CONDITIONAL([X86_64], [test x$arch = xx86_64])
 
@@ -152,15 +116,9 @@
 
 gl_WARN_ADD([-Wall])
 gl_WARN_ADD([-Wwrite-strings])
-if test "x$opsys" = "xsunos4"
-then
-	# SunOS 4.x header files don't declare int functions.
-	gl_WARN_ADD([-Wno-implicit])
-fi
 AC_SUBST([WARN_CFLAGS])
 
 AC_PROG_CPP
-AC_PROG_GCC_TRADITIONAL
 AC_PROG_INSTALL
 AC_C_CONST
 AC_C_BIGENDIAN
@@ -196,18 +154,11 @@
 AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
 AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
 
-if test x$opsys != xlinux; then
-AC_CHECK_LIB(nsl, main)
-fi
-
 AC_CHECK_FUNCS([ \
 	fork \
-	getdents \
 	if_indextoname \
 	inet_ntop \
-	mctl \
 	prctl \
-	pread \
 	sendmsg \
 	sigaction \
 	strerror \
@@ -224,23 +175,15 @@
 	mqueue.h \
 	poll.h \
 	stropts.h \
-	termio.h \
 	sys/acl.h \
-	sys/aio.h \
 	sys/asynch.h \
 	sys/conf.h \
-	sys/door.h \
 	sys/epoll.h \
 	sys/filio.h \
 	sys/ioctl.h \
-	sys/nscsys.h \
 	sys/poll.h \
 	sys/ptrace.h \
 	sys/reg.h \
-	sys/stream.h \
-	sys/sysconfig.h \
-	sys/tihdr.h \
-	sys/tiuser.h \
 	sys/uio.h \
 	sys/vfs.h \
 	asm/cachectl.h \
diff --git a/m4/stat.m4 b/m4/stat.m4
index 576abb0..bf0e480 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -2,13 +2,11 @@
 AC_DEFUN([AC_STAT64],
 [AC_MSG_CHECKING(for stat64 in (asm|sys)/stat.h)
 AC_CACHE_VAL(ac_cv_type_stat64,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#ifdef LINUX
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
 #include <linux/types.h>
 #include <asm/stat.h>
-#else
-#include <sys/stat.h>
-#endif]], [[struct stat64 st;]])],[ac_cv_type_stat64=yes],[ac_cv_type_stat64=no])])
+]], [[struct stat64 st;]])],[ac_cv_type_stat64=yes],[ac_cv_type_stat64=no])])
 AC_MSG_RESULT($ac_cv_type_stat64)
 if test "$ac_cv_type_stat64" = yes
 then
diff --git a/m4/statfs.m4 b/m4/statfs.m4
index 4651eca..1a2f971 100644
--- a/m4/statfs.m4
+++ b/m4/statfs.m4
@@ -2,10 +2,10 @@
 AC_DEFUN([AC_STATFS64],
 [AC_MSG_CHECKING(for statfs64 in sys/vfs.h)
 AC_CACHE_VAL(ac_cv_type_statfs64,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <linux/types.h>
 #include <sys/vfs.h>
-#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
+]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
 AC_MSG_RESULT($ac_cv_type_statfs64)
 if test "$ac_cv_type_statfs64" = yes
 then