Hylafax Mailing List Archives
|
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
Solution: /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.../../../sparc-sun-solaris2.7/include/assert.h
Thursday November 4 21:09:36 GMT 1999
My set up
Version: hylafax-v4.0pl2
Compiler: gcc-2.95.1
Computer: Sparc 5
OS : Solaris 2.7
Problem
make: *** No rule to make target `/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.../../../sparc-sun-solaris2.7/include/assert.h', needed by `faxcover.o'. Stop.
The error happens when the directory names for Makedepend are tidied or reduced.
Workaround
Manually (or automate with sed) edit the Makedepend files to correct
the path name when make fails.
Fix
The problem is in Makedepend and comes from "mkdepend.in". Near the end
it says:
# s:[^\./][^\./]*/\.\./::g rewrite "dir/../path" to be "path"
and adds the commands for sed, only it does not work.
It's easy enough to match "/.*/\.\.\/" and sub "/" except it must not
match "/../../" and sub "/". This is where the original attempt is
wrong; that's not how sed works.
As sed will only match the first match, it's best not to set the global
"g" flag. Now sed will succeed, but only if there is something to
match before the first "/../" eg the line does not begin with "/../../"
We need to not match if the first "/../". The problem with sed is it
can't not look for a sequence. It can match a ".." but can't not match
any thing that is a fixed string. So I first match the "/../" and
substitute a single character that sed can ``not match''.
Unix allows any characters in file names except null and slash, so I
can't rely on choosing a substitute character that is not in the file
name but I choose a "?" because it is a silly char to use normally. I
could choose something like BEL, but that might make files hard to edit
and print.
I also tidy up multiple slash eg "////" to "/".
The original did not tidy /././ fully either.
line 252 and 253 in ``hylafax-v4.0pl2/port/mkdepend.in''
old:
-e :loop -e 's:[^\./][^\./]*/\.\./::g' -e tloop \
-e 's:\([/ ]\)\./:\1:g' \
new:
-e s:///*:/:g \
-e :l1 -e 's:\([/ ]\)\./:\1:' -e 's:/\.\./:/?/:' -e tl1 \
-e :l2 -e 's:/[^/^?]*/?/:/:' -e tl2 -e 's:?:\.\.:g' \
If you are lost or want to check my logic,
(imagine we can add shell style comments):
cat > sed.script << EOF
# Note, sed won't accept these comments
s:///*:/:g # remove multiple slash, eg //// to /
:l1 # loop one
s:\([/ ]\)\./:\1: # sub " ./" with " " and sub "/./" with "/"
s:/\.\./:/?/: # sub "/../" with "/?/"
tl1 # loop until done
:l2 # loop two
s:/[^/^=]*/?/:/: # sub "/<anything but slash or ?>/?/" with "/"
tl2 # loop until done
s:?:\.\.:g # replace "?" with allowed ".."
EOF
Hope this helps.
James Lee.
from: james@james-lee.fsnet.co.uk