NetBSD Problem Report #8225

Received: (qmail 11700 invoked from network); 18 Aug 1999 14:55:07 -0000
Message-Id: <199908181455.HAA28488@nooksack.ldc.cs.wwu.edu>
Date: Wed, 18 Aug 1999 07:55:06 -0700 (PDT)
From: ac131313@cygnus.com
Reply-To: ac131313@cygnus.com
To: gnats-bugs@gnats.netbsd.org
Subject: Non NetBSD cross compile fails - test -h vs -L
X-Send-Pr-Version: www-1.0

>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
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 18 08:05:00 +0000 1999
>Closed-Date:    Sun Aug 22 14:07:32 +0000 1999
>Last-Modified:  Sun Aug 22 14:08:23 +0000 1999
>Originator:     Andrew Cagney
>Release:        Mon Jul 12 21:53:52 1999
>Organization:
>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}; \

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: kleink 
State-Changed-When: Sun Aug 22 07:07:32 PDT 1999 
State-Changed-Why:  
Fixed as suggested; -h is the primitive defined in both 1003.2bD3 and SVID4. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.