cproto-4.6/stamp-h
cproto-4.6/y.tab.c
cross
+lib/libc/conflicts.temp
+lib/libc/oldprotos.txt
+lib/libc/oldprotos.temp
+lib/libc/xx*
lib/libx_c.post
lib/libx_c/*.temp
lib/libx_c/compat-4.1/compat-4.1lib
netinet/in.h netns/ns.h
netinet/in_var.h netns/ns_if.h
protocols/talkd.h sys/namei.h
+stand/saio.h net/ruserpass.c
+stand/saio.h sys/errno.h
+stand/saio.h sys/inode.h
+stand/saio.h sys/file.h
+stand/saio.h sys/fs.h
vax/crl.h vax/flp.h
vax/mscp.h vax/tmscp.h
vax/reg.h gen/crypt.c net/ruserpass.c
--- /dev/null
+#!/bin/sh
+
+ROOT=../..
+
+all_c=
+while read i
+do
+ set $i
+ all_c="$all_c $1"
+done <groups.txt
+
+rm -f `find . -name '*.c.nocomm' -print`
+rm -f `find . -name '*.c.oldprotos' -print`
+rm -f `find . -name '*.c.protos' -print`
+rm -f `find . -name '*.c.protos.nocomm' -print`
+rm -f `find . -name '*.c.usedby' -print`
+rm -f `find . -name '*.c.uses' -print`
+
+rm -f $all_c
+git checkout $all_c
+
+rm -rf $ROOT/include
+git checkout $ROOT/include
+
+rm -rf $ROOT/sys
+git checkout $ROOT/sys
+
+rm -rf $ROOT/cross/usr/include
+mkdir $ROOT/cross/usr/include
+(cd ../../include && make DESTDIR=`pwd`/../cross SHARED=copies install)
#!/bin/sh
+ROOT=../..
+
+all_c=
+while read i
+do
+ set $i
+ all_c="$all_c $1"
+done <groups.txt
+all_h=`find $ROOT/cross/usr/include -type f -name '*.h' -print |LC_ALL=C sort`
+
rm -f oldprotos.txt
find . -name '*.[ch]' -print |\
sed -e 's:^\./::' |\
-while read i
+for i in $all_c $all_h
do
echo "i=$i"
grep '\.h:' oldprotos.txt >oldprotos.temp
-rm -f machine frame.h errno.h fcntl.h nlist.h signal.h syslog.h
-ln -s vax machine
-ln -s machine/frame.h frame.h
-ln -s sys/errno.h errno.h
-ln -s sys/file.h fcntl.h
-ln -s a.out.h nlist.h
-ln -s sys/signal.h signal.h
-ln -s sys/syslog.h syslog.h
-
while read i
do
set $i
i=$1
echo "i=$i"
- group=`echo $i |sed -ne 's/\/.*/\.h/p'`
+ group=$ROOT/cross/usr/include/`dirname $i`.h
echo "group=$group"
touch $group
if test $# -gt 1
then
echo "$2" >>$group.uses
- group=$2
+ group=$ROOT/cross/usr/include/$2
echo "group=$group"
touch $group
fi
- ../../cproto-4.6/cproto -i. -Dvax -t -H -s $i |sed -ne '2,$p' >$i.protos
+ $ROOT/cproto-4.6/cproto -i$ROOT/cross/usr/include -Dvax -t -H -s $i |sed -ne '2,$p' >$i.protos
grep -v "^static " <$i.protos >a
if test -s a
then
grep -v "^$group:" $i.oldprotos
fi
done <groups.txt
-
-rm -f machine frame.h errno.h fcntl.h nlist.h signal.h syslog.h
#!/bin/sh
-sed -e 's/^/:/;s/ /::/g;s/$/:/' <conflicts.txt >conflicts.temp
+ROOT=../..
-find . \( -name '*.[ch]' -o -name '*.[ch].protos' \) -print |\
-sed -e 's:\./::' |\
+all_c=
while read i
do
- ../../xify/nocomment <$i |../../xify/nostring >$i.nocomm
+ set $i
+ all_c="$all_c $1"
+done <groups.txt
+all_h=`find $ROOT/cross/usr/include -type f -name '*.h' -print |LC_ALL=C sort`
+all_h_rev=`find $ROOT/cross/usr/include -type f -name '*.h' -print |LC_ALL=C sort -r`
+
+all_c_nocomm=
+all_c_protos_nocomm=
+for i in $all_c
+do
+ $ROOT/xify/nocomment <$i |$ROOT/xify/nostring >$i.nocomm
+ all_c_nocomm="$all_c_nocomm $i.nocomm"
+ if test -f $i.protos
+ then
+ $ROOT/xify/nocomment <$i.protos |$ROOT/xify/nostring >$i.protos.nocomm
+ all_c_protos_nocomm="$all_c_protos_nocomm $i.protos.nocomm"
+ fi
done
-find . -name '*.h' -print |\
-sed -e 's:^\./::' |\
-LC_ALL=C sort -r |\
-while read i
+all_h_nocomm=
+all_h_protos_nocomm=
+for i in $all_h
+do
+ $ROOT/xify/nocomment <$i |$ROOT/xify/nostring >$i.nocomm
+ all_h_nocomm="$all_h_nocomm $i.nocomm"
+ if test -f $i.protos
+ then
+ $ROOT/xify/nocomment <$i.protos |$ROOT/xify/nostring >$i.protos.nocomm
+ all_h_protos_nocomm="$all_h_protos_nocomm $i.protos.nocomm"
+ fi
+done
+
+sed -e 's/^/:/;s/ /::/g;s/$/:/' <conflicts.txt >conflicts.temp
+
+for i in $all_h_rev
do
echo "i=$i"
+ h=`echo $i |sed -e "s:^$ROOT/cross/usr/include/::"`
+ echo "h=$h"
+
macros="`sed -ne 's/^#[ ]*define[ ]\+\([A-Za-z_][0-9A-Za-z_]*\).*/\1/p' $i.nocomm |grep -v '^\(NULL\)$'`"
echo "macros=$macros"
typedefs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?typedef[^0-9A-Za-z_]\(.*[^0-9A-Za-z_]\)\?\([A-Za-z_][0-9A-Za-z_]*\)[ ]*\(\[[ 0-9]*\][ ]*\)\?;.*/\3/p' $i.nocomm; sed -ne 's/^}[ ]*\([A-Za-z_][0-9A-Za-z_]*\)[ ]*;.*/\1/p' $i.nocomm`"
if test -n "$pattern0"
then
- grep -H "^\\($pattern0\\)$" `find . \( -name '*.c.nocomm' -o -name '*.protos.nocomm' \) -print |sed -e 's:^\./::'` |grep -v "^$i\.protos.nocomm:" >a
+ grep -H "^\\($pattern0\\)$" $all_c_nocomm $all_c_protos_nocomm $all_h_protos_nocomm |grep -v "^$i\.protos.nocomm:" >a
if test -s a
then
cat a >>$i.usedby
for j in `sed -e 's/\.protos\.nocomm:.*//; s/\.nocomm:.*//' <a |sort |uniq`
do
echo "j=$j"
- if ! grep -q ":$i:.*:$j\\|:$j:.*:$i:" conflicts.temp
+ k=`echo $j |sed -e "s:^$ROOT/cross/usr/include/::"`
+ echo "k=$k"
+ if ! grep -q ":$h:.*:$k\\|:$k:.*:$h:" conflicts.temp
then
- echo $i >>$j.uses
+ echo $h >>$j.uses
fi
done
fi
if test -n "$pattern0"
then
- grep -H "^\\($pattern0\\)$" `find . -name '*.h.nocomm' -print |sed -e 's:^\./::'` |grep -v "^$i\.nocomm:" >a
+ grep -H "^\\($pattern0\\)$" $all_h_nocomm |grep -v "^$i\.nocomm:" >a
if test -s a
then
cat a >>$i.usedby
for j in `sed -e 's/\.nocomm:.*//' <a |sort |uniq`
do
echo "j=$j"
- if ! grep -q ":$i:.*:$j\\|:$j:.*:$i:" conflicts.temp
+ k=`echo $j |sed -e "s:^$ROOT/cross/usr/include/::"`
+ echo "k=$k"
+ if ! grep -q ":$h:.*:$k\\|:$k:.*:$h:" conflicts.temp
then
- echo $i >>$j.uses
+ echo "no conflicts"
+ echo $h >>$j.uses
fi
done
fi
#!/bin/sh
-find . -name '*.h' -print |\
-sed -e 's:^\./::' |\
+ROOT=../..
+
+all_c=
while read i
+do
+ set $i
+ all_c="$all_c $1"
+done <groups.txt
+all_h=`find $ROOT/cross/usr/include -type f -name '*.h' -print |LC_ALL=C sort`
+
+for i in $all_h
do
echo "i=$i"
rm -f xx*
csplit -b '%05d' -q $i '/^#/' '{*}'
- if test -f xx00001 && ! ../../xify/nocomment <xx00000 |grep -q '[^ ]'
+ if test -f xx00001 && ! $ROOT/xify/nocomment <xx00000 |grep -q '[^ ]'
then
for j in xx*
do
echo "j=$j"
define="`sed -ne 's/^#[ ]*ifndef[ ]\+\([A-Za-z_][0-9A-Za-z_]*\).*/\1/p' xx00001`"
echo "define=$define"
- if test -n "$define" && grep -q '^#[ ]*endif$' $j && ! grep -v "^#" $j |../../xify/nocomment |grep -q '[^ ]'
+ if test -n "$define" && grep -q '^#[ ]*endif$' $j && ! grep -v "^#" $j |$ROOT/xify/nocomment |grep -q '[^ ]'
then
sed -e "s/^#[ ]*ifndef[ ]\\+$define/\\/\\*&\\*\\//" -i xx00001
sed -e "s/^\\(#[ ]*define[ ]\\+$define\\)[ ]*$/\\/\\*\1\\*\\//" -i xx00002
fi
done
-find . -name '*.[ch]' -print |\
-sed -e 's:^\./::' |\
-while read i
+for i in $all_c $all_h
do
echo "i=$i"
rm -f xx*
do
#sed -e 's/^#[ ]*include[ ]*\(<[^>]*>\|"[^"]*"\)/\/\*&\*\//' -i $j
sed -e 's/^#[ ]*include[ ]*<[^>]*>/\/\*&\*\//' -i $j
- if grep -v "^#[ ]*include[^0-9A-Za-z_]" $j |sed -e '/^#[ ]*if.*SCCS/,/^#[ ]*endif/s/.*//' |../../xify/nocomment |grep -q '[^ ]'
+ if grep -v "^#[ ]*include[^0-9A-Za-z_]" $j |sed -e '/^#[ ]*if.*SCCS/,/^#[ ]*endif/s/.*//' |$ROOT/xify/nocomment |grep -q '[^ ]'
then
break
fi
cat xx* >$i
done
-find . -name '*.h' -print |\
-sed -e 's:^\./::' |\
-while read i
+for i in $all_c
+do
+ echo "i=$i"
+
+ if test -s $i.protos && grep '^static ' $i.protos >a
+ then
+ pattern="`sed -ne '1{s/\*/\\\*/g; s/ __P((.*));/(/p}' $i.protos`"
+ echo "pattern=$pattern"
+ rm -f xx*
+ csplit -q $i "/^$pattern/"
+ if test -f xx01
+ then
+ (
+ echo
+ cat xx01
+ ) >>a
+ fi
+ cat xx00 a >$i
+ fi
+
+ rm -f a
+ if test -s $i.uses
+ then
+ LC_ALL=C sort <$i.uses |uniq >a
+
+ pattern=
+ prefix=
+ for j in `cat a`
+ do
+ pattern="$pattern$prefix$j"
+ prefix='\|'
+ done
+ echo "pattern=$pattern"
+
+ sed -e "s:^#[ ]*include[ ]*\\(<\\($pattern\\)>\\|\"\\($pattern\\)\"\\):\\/\\*&\\*\\/:" -i $i
+ fi
+
+ (
+ if test -s a
+ then
+ sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#define _va_start(argp, arg) va_start(argp, arg)\n#else\n#include <varargs.h>\n#define _va_start(argp, arg) va_start(argp)\n#endif/' a
+ echo
+ fi
+ sed -e 's/\([^0-9A-Za-z_]\)va_start(argp);/\1_va_start(argp, fmt);/' $i
+ ) |$ROOT/xify/newline >b
+ mv b $i
+done
+
+for i in $all_h
do
echo "i=$i"
+ h=`echo $i |sed -e "s:^$ROOT/cross/usr/include/::"`
+ echo "h=$h"
rm -f a
if test -s $i.uses
sed -e "s:^#[ ]*include[ ]*\\(<\\($pattern\\)>\\|\"\\($pattern\\)\"\\):\\/\\*&\\*\\/:" -i $i
fi
- name=_`echo $i |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_
+ name=_`echo $h |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_
echo "name=$name"
(
cat <<EOF
#endif
EOF
- ) |../../xify/newline >b
- mv b $i
-done
-
-find . -name '*.c' -print |\
-sed -e 's:^\./::' |\
-while read i
-do
- echo "i=$i"
-
- if test -s $i.protos && grep '^static ' $i.protos >a
- then
- pattern="`sed -ne '1{s/\*/\\\*/g; s/ __P((.*));/(/p}' $i.protos`"
- echo "pattern=$pattern"
- rm -f xx*
- csplit -q $i "/^$pattern/"
- if test -f xx01
- then
- (
- echo
- cat xx01
- ) >>a
- fi
- cat xx00 a >$i
- fi
-
- rm -f a
- if test -s $i.uses
- then
- LC_ALL=C sort <$i.uses |uniq >a
-
- pattern=
- prefix=
- for j in `cat a`
- do
- pattern="$pattern$prefix$j"
- prefix='\|'
- done
- echo "pattern=$pattern"
-
- sed -e "s:^#[ ]*include[ ]*\\(<\\($pattern\\)>\\|\"\\($pattern\\)\"\\):\\/\\*&\\*\\/:" -i $i
- fi
-
- (
- if test -s a
- then
- sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#define _va_start(argp, arg) va_start(argp, arg)\n#else\n#include <varargs.h>\n#define _va_start(argp, arg) va_start(argp)\n#endif/' a
- echo
- fi
- sed -e 's/\([^0-9A-Za-z_]\)va_start(argp);/\1_va_start(argp, fmt);/' $i
- ) |../../xify/newline >b
+ ) |$ROOT/xify/newline >b
mv b $i
done
--- /dev/null
+#!/bin/sh
+
+ROOT=../..
+
+all_c=
+while read i
+do
+ set $i
+ all_c="$all_c $1"
+done <groups.txt
+all_h=`find $ROOT/cross/usr/include -type f -name '*.h' -print |LC_ALL=C sort`
+
+# checking header loops
+grep -H '^#include <[^>]*>' $all_h |\
+sed -e "s:^$ROOT/cross/usr/include/\(.*\)\:#include <\(.*\)>:\1 \2:" |\
+tsort >a
+
+# removing useless extra header inclusions that are pulled in anyway
+touch $ROOT/cross/usr/include/stdarg.h
+rm -f a
+for i in $all_h
+do
+ echo "i=$i"
+ h=`echo $i |sed -e "s:^$ROOT/cross/usr/include/::"`
+ echo "h=$h"
+
+ pattern=
+ prefix=
+ cp $i temp.c
+ for j in `cpp -nostdinc -I$ROOT/cross/usr/include -Dvax -DNCMD=1 -DNRSP=1 -M temp.c`
+ do
+ case $j in
+ $ROOT/cross/usr/include/stdarg.h)
+ # system header files are not supposed to define stdarg.h, even if
+ # (like vfprintf etc) they have va_list paramters, it silly and
+ # we ignore this restriction, but clients shouldn't rely on this
+ # (anyway, the above cpp command defines __STDC__ so we do not pick
+ # up any dependency on varargs.h, hence let's keep it symmetrical)
+ ;;
+ $ROOT/cross/usr/include/*.h)
+ k=`echo $j |sed -e "s:^$ROOT/cross/usr/include/::"`
+ echo "$h $k" >>a
+ pattern="$pattern$prefix$k"
+ prefix='\|'
+ ;;
+ esac
+ done
+ echo "pattern=$pattern"
+ if test -n "$pattern"
+ then
+ sed -e "s:^#include <\\($pattern\\)>$:/\\*& $h\\*/:" -i `grep -H "^#include <$h>$" $all_c $all_h |sed -e 's/:.*//'`
+ fi
+done
+rm -f $ROOT/cross/usr/include/stdarg.h temp.c
+tsort <a >b
+
+#rm -rf ../libx_c.post
+#cp -r ../libx_c ../libx_c.post
+#patch --strip 1 <post.patch
--- /dev/null
+#!/bin/sh
+
+ROOT=../..
+
+for i in . arpa protocols
+do
+ echo "i=$i"
+ for j in $ROOT/include/$i/*.h
+ do
+ echo "j=$j"
+ cp $ROOT/cross/usr/include/$i/`basename $j` $ROOT/include/$i
+ done
+done
+for i in compat-4.1 compat-sys5 gen inet net ns stdio sys
+do
+ echo "i=$i"
+ cp $ROOT/cross/usr/include/$i.h $ROOT/include
+done
+for i in net netimp netinet netns vax vaxif vaxmba vaxuba
+do
+ echo "i=$i"
+ for j in $ROOT/sys/$i/*.h
+ do
+ echo "j=$j"
+ cp $ROOT/cross/usr/include/$i/`basename $j` $ROOT/sys/$i
+ done
+done
+for i in $ROOT/sys/h/*.h
+do
+ echo "i=$i"
+ cp $ROOT/cross/usr/include/sys/`basename $i` $ROOT/sys/h
+done
+++ /dev/null
-#!/bin/sh
-for i in . arpa protocols
-do
- rm ../../include/$i/*.h
- mv $i/*.h ../../include/$i
-done
-for i in net netimp netinet netns vax vaxif vax/inline vaxmba vaxuba
-do
- rm ../../sys/$i/*.h
- mv $i/*.h ../../sys/$i
-done
-rm ../../sys/h/*.h
-mv sys/*.h ../../sys/h
-for i in compat-4.1 compat-sys5 gen inet net net/hosttable net/named ns stdio
-do
- rm ../libc/$i/*.c ../libc/$i/Makefile
- mv $i/*.c $i/Makefile ../libc/$i
-done
-mkdir ../libc/sys
-mv sys/*.c sys/Makefile ../libc/sys
+++ /dev/null
-#!/bin/sh
-
-# checking header loops
-grep -H '^#include <[^>]*>' `find . -name '*.h' -print` |\
-sed -e 's/^\.\/\(.*\):#include <\(.*\)>/\1 \2/' |\
-tsort >a
-
-# see make install-headers
-ln -s vax machine
-ln -s machine/frame.h frame.h
-ln -s sys/errno.h errno.h
-ln -s sys/file.h fcntl.h
-ln -s a.out.h nlist.h
-ln -s sys/signal.h signal.h
-#ln -s gen.h stdlib.h
-ln -s sys/syslog.h syslog.h
-#ln -s sys.h unistd.h
-cat <<EOF >stdarg.h
-#ifndef _STDARG_H_
-#define _STDARG_H_
-
-typedef char *va_list;
-
-#endif
-EOF
-
-# removing useless extra header inclusions that are pulled in anyway
-all=`find . -type f -name '*.[ch]' -print`
-rm -f a
-find . -type f -name '*.h' -print |\
-sed -e 's:\./::' |\
-LC_ALL=C sort |\
-while read i
-do
- echo "i=$i"
- pattern=
- prefix=
- cp $i temp.c
- for j in `cpp -nostdinc -I. -Dvax -DNCMD=1 -DNRSP=1 -M temp.c`
- do
- case $j in
- stdarg.h)
- # system header files are not supposed to define stdarg.h, even if
- # (like vfprintf etc) they have va_list paramters, it silly and
- # we ignore this restriction, but clients shouldn't rely on this
- # (anyway, the above cpp command defines __STDC__ so we do not pick
- # up any dependency on varargs.h, hence let's keep it symmetrical)
- ;;
- *.h)
- echo "$i $j" >>a
- pattern="$pattern$prefix$j"
- prefix='\|'
- ;;
- esac
- done
- echo "pattern=$pattern"
- if test -n "$pattern"
- then
- sed -e "s:^#include <\\($pattern\\)>$:/\\*& $i\\*/:" -i `grep -H "^#include <$i>$" $all |sed -e 's/:.*//'`
- fi
-done
-rm -f temp.c
-tsort <a >b
-
-# see make install-headers
-rm machine
-rm frame.h
-rm errno.h
-rm fcntl.h
-rm nlist.h
-rm signal.h
-#rm stdlib.h
-rm syslog.h
-#rm unistd.h
-rm stdarg.h
-
-rm -rf ../libx_c.post
-cp -r ../libx_c ../libx_c.post
-patch --strip 1 <post.patch