Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-users] hylafax mkdepend mishandles symlinks and GCC paths (Solaris 8, gcc)



I ran into a problem when porting hylafax-v4.0pl2 to Solaris 8 sparc,
using /opt/sfw/bin/gcc (the version of GCC 2.95.2 that is distributed
with Sun's Bonus CD).  The same problem occurs in hylafax-4.1beta2.

The problem is that mkdepend computes the following bogus dependency:

	Array.o: Array.c++ Array.h Obj.h Types.h ${INCLDIR}/string.h \
	 ... \
	 /opt/sfw/lib/gcc-lib/sparc-sun-solaris2.8/2.95.../../../sparc-sun-solaris2.8/include/assert.h \
	 ...

The ".../.." is incorrect.  This bogus dependency causes "make" to fail.

The culprit is the following command in port/mkdepend.in:

	-e :loop -e 's:[^\./][^\./]*/\.\./::g' -e tloop \

This command transforms the line:

	/opt/sfw/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/../../../../sparc-sun-solaris2.8/include/assert.h \

to:

	/opt/sfw/lib/gcc-lib/sparc-sun-solaris2.8/2.95.../../../sparc-sun-solaris2.8/include/assert.h \

Trying to remove "FOO/../" is a mistake, even if this particular sed
botch could be patched up, because it doesn't work if FOO is a
symbolic link.

Here's a patch.

2000-06-23  Paul Eggert  <eggert@twinsun.com>

	* port/mkdepend.in: Don't try to optimize "a/b/../d" into
	"a/d".  This is incorrect if b is a symbolic link.  Also, the
	code was broken anyway: it transformed "/2.95.2/../"
	into "/2.95.../".

===================================================================
RCS file: port/mkdepend.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -pu -r1.1 -r1.2
--- port/mkdepend.in	1998/10/12 20:47:50	1.1
+++ port/mkdepend.in	2000/06/24 00:57:32	1.2
@@ -249,7 +249,6 @@ fi
 depgenxx=`echo $depgen|sed -e s/\'//g -e 's/(/\\(/g' -e 's/)/\\)/g'`
 $depgenxx $* |
     eval "sed \
-	-e :loop -e 's:[^\./][^\./]*/\.\./::g' -e tloop \
 	-e 's:\([/ ]\)\./:\1:g' \
 	$sedprog" |
     $AWK "$awkprog" >> $newdepfile


____________________ HylaFAX(tm) Users Mailing List _______________________
 To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services