summaryrefslogtreecommitdiff
path: root/osdef.sh
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2011-09-03 14:05:19 +0200
committerAxel Beckert <abe@deuxchevaux.org>2011-09-03 14:05:19 +0200
commit0636e9ecb5a32db4d4520f50a20652faa825feaf (patch)
treeb94df9221e8ae0de0dc3afac301d5b63b136a7b4 /osdef.sh
downloadscreen-0636e9ecb5a32db4d4520f50a20652faa825feaf.tar.gz
Imported Upstream version 3.7.2upstream/3.7.2
Diffstat (limited to 'osdef.sh')
-rw-r--r--osdef.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/osdef.sh b/osdef.sh
new file mode 100644
index 0000000..3ecc4d7
--- /dev/null
+++ b/osdef.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+
+if test -z "$CC"; then
+ CC=cc
+fi
+if test -z "$srcdir"; then
+ srcdir=.
+fi
+
+sed < $srcdir/osdef.h.in -n -e '/^extern/s@.*[)* ][)* ]*\([^ *]*\) __P.*@/[)*, ]\1[ (]/i\\\
+\\/\\[^a-zA-Z_\\]\1 __P\\/d@p' > osdef1.sed
+cat << EOF > osdef0.c
+#include "config.h"
+#include <sys/types.h>
+#include <stdio.h>
+#include <signal.h>
+#include <sys/stat.h>
+#include <pwd.h>
+#ifdef SHADOWPW
+#include <shadow.h>
+#endif
+#ifndef sun
+#include <sys/ioctl.h>
+#endif
+#ifndef NAMEDPIPE
+#include <sys/socket.h>
+#endif
+#include "os.h"
+#if defined(UTMPOK) && defined (GETTTYENT) && !defined(GETUTENT)
+#include <ttyent.h>
+#endif
+#ifdef SVR4
+# include <sys/resource.h>
+#endif
+EOF
+cat << EOF > osdef2.sed
+1i\\
+/*
+1i\\
+ * This file is automagically created from osdef.sh -- DO NOT EDIT
+1i\\
+ */
+EOF
+$CC -I. -I$srcdir -E osdef0.c | sed -n -f osdef1.sed >> osdef2.sed
+sed -f osdef2.sed < $srcdir/osdef.h.in > osdef.h
+rm osdef0.c osdef1.sed osdef2.sed