#!/bin/csh -f # # Make a copy of a systems include dir using symbolic links # and merge some essential SYS5 includes into this tree. # # To be called from the main perl directory. # # Usage: # makeincludedir [-test] # # Parameter: # -test show what will be done without actually doing it # # 5/95 J.E.Klasek (jk@auto.tuwien.ac.at) # set myname=$0 set myname=$myname:t set path=($path /sys5/bin) set inc=/usr/include set newinc=inc # this includes are linked into the new tree from the SYS5 tree set sys5includes=(sys/{shm.h,msg.h,sem.h,utsname.h,ipc.h}) # this includes are extented by corresponding files with the extension # ".add" which should exist in the current or upper directories. set mergedincludes=(fcntl.h) set ln=/tmp/.mklink set mkdir=/tmp/.mkdir set ftest="" set expr=eval if (`uname` != "DomainOS") then echo "${myname}: only for HP/Apollo DomainOS hosts. Exiting." exit 1 endif # test mode: no modification if ("$1" == "-test") then shift set ftest=echo alias ln 'echo ln ' alias mv 'echo mv ' set expr=echo endif echo "creating new includefile tree $newinc" echo "" if (! -d $newinc && "$ftest" == "") mkdir $newinc set cdir=$cwd if (! `expr "x$newinc" : '^x/..*'`) then # not a absolut path, make it absolute set newinc="$cdir/$newinc" endif cd $inc set um=`umask` umask 077 onintr cleanup # temporary scripts cat >$ln <$mkdir < $newinc/$h) && echo ' '$h" end echo "" echo "$newinc completed." cleanup: /bin/rm -f $ln $mkdir