📄 fixinc.svr4
字号:
else echo '#ifdef _KERNEL' > /tmp/$base cat $file_to_fix >> /tmp/$base echo '#endif /* defined(_KERNEL) */' >> /tmp/$base echo Fixed $file_to_fix rm -f ${LIB}/$file cp /tmp/$base ${LIB}/$file rm -f /tmp/$base fifi# Conditionalize all of <sys/cmn_err.h> on _KERNEL being defined.file=sys/cmn_err.hbase=`basename $file`if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$fileelse if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fifiif [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix if grep _KERNEL $file_to_fix > /dev/null; then echo No change needed in $file_to_fix else echo '#ifdef _KERNEL' > /tmp/$base cat $file_to_fix >> /tmp/$base echo '#endif /* defined(_KERNEL) */' >> /tmp/$base echo Fixed $file_to_fix rm -f ${LIB}/$file cp /tmp/$base ${LIB}/$file rm -f /tmp/$base fifi# Conditionalize all of <sys/kdebugger.h> on _KERNEL being defined.file=sys/kdebugger.hbase=`basename $file`if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$fileelse if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fifiif [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix if grep _KERNEL $file_to_fix > /dev/null; then echo No change needed in $file_to_fix else echo '#ifdef _KERNEL' > /tmp/$base cat $file_to_fix >> /tmp/$base echo '#endif /* defined(_KERNEL) */' >> /tmp/$base echo Fixed $file_to_fix rm -f ${LIB}/$file cp /tmp/$base ${LIB}/$file rm -f /tmp/$base fifi# Conditionalize some of <netinet/in.h> on _KERNEL being defined.file=netinet/in.hbase=`basename $file`if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$fileelse if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fifiif [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix if grep _KERNEL $file_to_fix > /dev/null; then echo No change needed in $file_to_fix else sed -e '/#ifdef INKERNEL/i\#ifdef _KERNEL' \ -e '/#endif[ ]*\/\* INKERNEL \*\//a\#endif /* _KERNEL */' \ $file_to_fix > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file echo Fixed $file_to_fix fifi# Conditionalize some of <sys/endian.h> on __GNUC__ and __GNUG__.file=sys/endian.hbase=`basename $file`if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$fileelse if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fifiif [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix if grep __GNUC__ $file_to_fix > /dev/null; then echo No change needed in $file_to_fix else sed -e '/# ifdef __STDC__/i\# if !defined (__GNUC__) && !defined (__GNUG__)' \ -e '/# include <sys\/byteorder.h>/s/ / /'\ -e '/# include <sys\/byteorder.h>/i\# endif /* !defined (__GNUC__) && !defined (__GNUG__) */'\ $file_to_fix > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file echo Fixed $file_to_fix fifi# Commented out because tmcconne@sedona.intel.com says we don't clearly need it# and the text in types.h is not erroneous.## In sys/types.h, don't name the enum for booleans.##file=sys/types.h#base=`basename $file`#if [ -r ${LIB}/$file ]; then# file_to_fix=${LIB}/$file#else# if [ -r ${INPUT}/$file ]; then# file_to_fix=${INPUT}/$file# else# file_to_fix=""# fi#fi#if [ \! -z "$file_to_fix" ]; then# echo Checking $file_to_fix# if grep "enum boolean" $file_to_fix > /dev/null; then# sed -e 's/enum boolean/enum/' ${LIB}/$file > ${LIB}/${file}.sed# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file# echo Fixed $file_to_fix# else# echo No change needed in $file_to_fix# fi#fi# Remove useless extern keyword from struct forward declarations in# <sys/stream.h> and <sys/strsubr.h>file=sys/stream.hbase=`basename $file`if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$fileelse if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fifiif [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix sed -e ' s/extern struct stdata;/struct stdata;/g s/extern struct strevent;/struct strevent;/g ' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ echo No change needed in $file_to_fix else echo Fixed $file_to_fix rm -f ${LIB}/$file cp /tmp/$base ${LIB}/$file fi rm -f /tmp/$basefifile=sys/strsubr.hbase=`basename $file`if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$fileelse if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fifiif [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix sed -e ' s/extern struct strbuf;/struct strbuf;/g s/extern struct uio;/struct uio;/g s/extern struct thread;/struct thread;/g s/extern struct proc;/struct proc;/g ' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ echo No change needed in $file_to_fix else echo Fixed $file_to_fix rm -f ${LIB}/$file cp /tmp/$base ${LIB}/$file fi rm -f /tmp/$basefi# Convert functions to prototype form, and fix arg names in <sys/stat.h>.file=sys/stat.hbase=`basename $file`if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$fileelse if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fifiif [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base ex /tmp/$base <<EOF/^stat(path, buf)/jj-/^stat(path, buf)/cstat (const char *path, struct stat *buf)./^lstat(path, buf)/jj-/^lstat(path, buf)/clstat (const char *path, struct stat *buf)./^fstat(fd, buf)/jj-/^fstat(fd, buf)/cfstat (int fd, struct stat *buf)./^mknod(path, mode, dev)/jjj-/^mknod(path, mode, dev)/cmknod (const char *path, mode_t mode, dev_t dev).1,\$s/path/__path/g1,\$s/buf/__buf/g1,\$s/fd/__fd/g1,\$s/ret\\([^u]\\)/__ret\1/g1,\$s/\\([^_]\\)mode\\([^_]\\)/\\1__mode\\2/g1,\$s/\\([^_r]\\)dev\\([^_]\\)/\\1__dev\\2/gwqEOF echo Fixed $file_to_fix rm -f ${LIB}/$file cp /tmp/$base ${LIB}/$file rm -f /tmp/$basefi# Sony NEWSOS 5.0 does not support the complete ANSI C standard.if [ -x /bin/sony ]; then if /bin/sony; then # Change <stdio.h> to not define __filbuf, __flsbuf, and __iob file=stdio.h base=`basename $file` if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$file else if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fi fi if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base sed -e ' s/__filbuf/_filbuf/g s/__flsbuf/_flsbuf/g s/__iob/_iob/g ' /tmp/$base > /tmp/$base.sed mv /tmp/$base.sed /tmp/$base if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then echo No change needed in $file_to_fix else echo Fixed $file_to_fix rm -f ${LIB}/$file cp /tmp/$base ${LIB}/$file fi rm -f /tmp/$base fi # Change <ctype.h> to not define __ctype file=ctype.h base=`basename $file` if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$file else if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fi fi if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix cp $file_to_fix /tmp/$base chmod +w /tmp/$base sed -e ' s/__ctype/_ctype/g ' /tmp/$base > /tmp/$base.sed mv /tmp/$base.sed /tmp/$base if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then echo No change needed in $file_to_fix else echo Fixed $file_to_fix rm -f ${LIB}/$file cp /tmp/$base ${LIB}/$file fi rm -f /tmp/$base fi fifi# In limits.h, put #ifndefs around things that are supposed to be defined# in float.h to avoid redefinition errors if float.h is included first.# Solaris 2.1 has this problem.file=limits.hbase=`basename $file`if [ -r ${LIB}/$file ]; then file_to_fix=${LIB}/$fileelse if [ -r ${INPUT}/$file ]; then file_to_fix=${INPUT}/$file else file_to_fix="" fifiif [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix sed -e '/[ ]FLT_MIN[ ]/i\#ifndef FLT_MIN'\ -e '/[ ]FLT_MIN[ ]/a\#endif'\ -e '/[ ]FLT_MAX[ ]/i\#ifndef FLT_MAX'\ -e '/[ ]FLT_MAX[ ]/a\#endif'\ -e '/[ ]FLT_DIG[ ]/i\#ifndef FLT_DIG'\ -e '/[ ]FLT_DIG[ ]/a\#endif'\ -e '/[ ]DBL_MIN[ ]/i\#ifndef DBL_MIN'\ -e '/[ ]DBL_MIN[ ]/a\#endif'\ -e '/[ ]DBL_MAX[ ]/i\#ifndef DBL_MAX'\ -e '/[ ]DBL_MAX[ ]/a\#endif'\ -e '/[ ]DBL_DIG[ ]/i\#ifndef DBL_DIG'\ -e '/[ ]DBL_DIG[ ]/a\#endif' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ echo No change needed in $file_to_fix else echo Fixed $file_to_fix rm -f ${LIB}/$file cp /tmp/$base ${LIB}/$file fi rm -f /tmp/$basefiecho 'Removing unneeded directories:'cd $LIBfiles=`find . -type d -print | sort -r`for file in $files; do rmdir $LIB/$file > /dev/null 2>&1doneif $LINKS; then echo 'Making internal symbolic non-directory links' cd ${INPUT} files=`find . -type l -print` for file in $files; do dest=`ls -ld $file | sed -n 's/.*-> //p'` if expr "$dest" : '[^/].*' > /dev/null; then target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"` if [ -f $target ]; then ln -s $dest ${LIB}/$file >/dev/null 2>&1 fi fi doneficd ${ORIG_DIR}echo 'Replacing <sys/byteorder.h>'rm -f ${LIB}/sys/byteorder.hcp ${SRCDIR}/byteorder.h ${LIB}/sys/byteorder.hexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -