Introduce canvas.showwin() interface.
[screen-lua.git] / src / osdef.sh
blobb2811757dccf39d1b5a1008059baf7be9c6b9eca
1 #! /bin/sh
3 if test -z "$CPP"; then
4 CPP="cc -E"
5 fi
6 if test -z "$srcdir"; then
7 srcdir=.
8 fi
10 rm -f core*
12 sed < $srcdir/osdef.h.in -n -e '/^extern/s@.*[)* ][)* ]*\([^ *]*\) __P.*@/[)*, ]\1[ (]/i\\\
13 \\/\\[^a-zA-Z_\\]\1 __P\\/d@p' > osdef1.sed
14 cat << EOF > osdef0.c
15 #include "config.h"
16 #include <sys/types.h>
17 #include <stdio.h>
18 #include <signal.h>
19 #include <sys/stat.h>
20 #include <pwd.h>
21 #ifdef SHADOWPW
22 #include <shadow.h>
23 #endif
24 #ifndef sun
25 #include <sys/ioctl.h>
26 #endif
27 #ifdef linux
28 #include <string.h>
29 #include <stdlib.h>
30 #endif
31 #ifndef NAMEDPIPE
32 #include <sys/socket.h>
33 #endif
34 #ifndef NOSYSLOG
35 #include <syslog.h>
36 #endif
37 #include "os.h"
38 #if defined(UTMPOK) && defined (GETTTYENT) && !defined(GETUTENT)
39 #include <ttyent.h>
40 #endif
41 #ifdef SVR4
42 # include <sys/resource.h>
43 #endif
44 EOF
45 cat << EOF > osdef2.sed
46 1i\\
48 1i\\
49 * This file is automagically created from osdef.sh -- DO NOT EDIT
50 1i\\
52 EOF
53 $CPP -I. -I$srcdir osdef0.c | sed -n -f osdef1.sed >> osdef2.sed
54 sed -f osdef2.sed < $srcdir/osdef.h.in > osdef.h
55 rm osdef0.c osdef1.sed osdef2.sed
57 if test -f core*; then
58 file core*
59 echo " Sorry, your sed is broken. Call the system administrator."
60 echo " Meanwhile, you may try to compile screen with an empty osdef.h file."
61 echo " But if your compiler needs to have all functions declared, you should"
62 echo " retry 'make' now and only remove offending lines from osdef.h later."
63 exit 1
65 if eval test "`diff osdef.h $srcdir/osdef.h.in | wc -l`" -eq 4; then
66 echo " Hmm, sed is very pessimistic about your system header files."
67 echo " But it did not dump core -- strange! Let's continue carefully..."
68 echo " If this fails, you may want to remove offending lines from osdef.h"
69 echo " or try with an empty osdef.h file, if your compiler can do without"
70 echo " function declarations."