summaryrefslogtreecommitdiff
path: root/src/osdef.sh
diff options
context:
space:
mode:
authorjnweiger <jnweiger>2005-12-15 15:53:32 +0000
committerjnweiger <jnweiger>2005-12-15 15:53:32 +0000
commit91f7dc8e5d2d4225f532e698030a89c71a1cc451 (patch)
tree7f8f7a90f122d97b7777c23b42d1e63873284aab /src/osdef.sh
parent8b9339a5f62b31ff25b3ebc6526701be8b0b6ef1 (diff)
downloadscreen-91f7dc8e5d2d4225f532e698030a89c71a1cc451.tar.gz
Initial checkin of screen-4.0.2 as found on SUSE 10.0
Diffstat (limited to 'src/osdef.sh')
-rw-r--r--src/osdef.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/osdef.sh b/src/osdef.sh
new file mode 100644
index 0000000..b281175
--- /dev/null
+++ b/src/osdef.sh
@@ -0,0 +1,71 @@
+#! /bin/sh
+
+if test -z "$CPP"; then
+ CPP="cc -E"
+fi
+if test -z "$srcdir"; then
+ srcdir=.
+fi
+
+rm -f core*
+
+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
+#ifdef linux
+#include <string.h>
+#include <stdlib.h>
+#endif
+#ifndef NAMEDPIPE
+#include <sys/socket.h>
+#endif
+#ifndef NOSYSLOG
+#include <syslog.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
+$CPP -I. -I$srcdir 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
+
+if test -f core*; then
+ file core*
+ echo " Sorry, your sed is broken. Call the system administrator."
+ echo " Meanwhile, you may try to compile screen with an empty osdef.h file."
+ echo " But if your compiler needs to have all functions declared, you should"
+ echo " retry 'make' now and only remove offending lines from osdef.h later."
+ exit 1
+fi
+if eval test "`diff osdef.h $srcdir/osdef.h.in | wc -l`" -eq 4; then
+ echo " Hmm, sed is very pessimistic about your system header files."
+ echo " But it did not dump core -- strange! Let's continue carefully..."
+ echo " If this fails, you may want to remove offending lines from osdef.h"
+ echo " or try with an empty osdef.h file, if your compiler can do without"
+ echo " function declarations."
+fi