Subject: kern/8225: Non NetBSD cross compile fails - test -h vs -L
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ac131313@cygnus.com>
List: netbsd-bugs
Date: 08/18/1999 08:43:50
>Number:         8225
>Category:       kern
>Synopsis:       Non NetBSD cross compile fails - test -h vs -L
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 18 08:05:00 1999
>Last-Modified:
>Originator:     Andrew Cagney
>Organization:
>Release:        Mon Jul 12 21:53:52 1999
>Environment:
FreeBSD b1.cygnus.com 3.2-RELEASE FreeBSD 3.2-RELEASE #4: Tue Jun 29 15:55:17 EST 1999
root@b1.cygnus.com:/usr/src/sys/compile/B2pcm  i386

>Description:
There are two different options that can be used to test
for a soft link: -L and -h.  I believe that -h is more
widely supported.

Oh, your man page reads:

     -h file       True if file exists and is a symbolic link.  This operator
                   is retained for compatibility with previous versions of
                   this program. Do not rely on its existence; use -L instead.

which could lead to an interesting response.


>How-To-Repeat:
Try cross compiling a kernel on a system with a test that
doesn't support -L.  Command fails.

>Fix:
Index: ./share/mk/bsd.kinc.mk
===================================================================
RCS file: /cvsroot/sharesrc/share/mk/bsd.kinc.mk,v
retrieving revision 1.5
diff -p -r1.5 bsd.kinc.mk
*** bsd.kinc.mk 1999/02/04 11:58:30     1.5
--- bsd.kinc.mk 1999/08/16 05:36:24
*************** SYMLINKS+=      ${KDIR} ${INCSDIR}
*** 67,73 ****
  .PRECIOUS: ${DESTDIR}${INCSDIR}
  .PHONY: ${DESTDIR}${INCSDIR}
  ${DESTDIR}${INCSDIR}:
!       @if [ ! -d ${.TARGET} ] || [ -L ${.TARGET} ] ; then \
                echo creating ${.TARGET}; \
                /bin/rm -rf ${.TARGET}; \
                ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 ${.TARGET}; \
--- 67,73 ----
  .PRECIOUS: ${DESTDIR}${INCSDIR}
  .PHONY: ${DESTDIR}${INCSDIR}
  ${DESTDIR}${INCSDIR}:
!       @if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
                echo creating ${.TARGET}; \
                /bin/rm -rf ${.TARGET}; \
                ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 ${.TARGET}; \

>Audit-Trail:
>Unformatted: