tech-toolchain archive

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

Re: build.sh release failure with relative path



On 25.03.10 10:22, Christoph Egger wrote:
>>
>>    On 22.03.10 14:29, Christoph Egger wrote:
>>    > 
>>    > Hi!
>>    > 
>>    > When $KERNOBJDIR is a relative path then build.sh release
>>    > fails with 
>>    > 
>>    >       nbconfig: cannot create $KERNOBJDIR/GENERIC
>>    > 
>>    > There are two ways to fix this:
>>    > 
>>    > 1. Fix nbconfig to prepend prefix to builddir specified
>>    >    via -b
>>    > 2. Fix call to nbconfig by prepending prefix to the kernel
>>    >    config file (removes change directory to kernel
>>    >    config dir)
>>    
>>    Other ways found are to fix build.sh or let build.sh reject
>>    relative path.
>>
>>
>> i'd rather reject relative paths, or fix it in build.sh.
>>
> 
> I have a fix for build.sh
> 
> http://www.netbsd.org/~cegger/build.sh.diff

Again, this time as an attachment.

Christoph

Index: build.sh
===================================================================
RCS file: /cvsroot/src/build.sh,v
retrieving revision 1.231
diff -u -p -r1.231 build.sh
--- build.sh    7 Mar 2010 17:34:25 -0000       1.231
+++ build.sh    25 Mar 2010 09:14:10 -0000
@@ -259,6 +259,17 @@ initdefaults()
        #
        setmakeenv NETBSDSRCDIR "${TOP}"
 
+       # Make sure KERNOBJDIR is an absolute path if defined
+       #
+       if [ -n "${KERNOBJDIR}" ]; then
+               echo "${KERNOBJDIR}" | grep "^/" >/dev/null
+               if [ $? -ne 0 ]; then
+                       # KERNOBJDIR is a relative path
+                       # Make it absolute
+                       setmakeenv KERNOBJDIR "${TOP}/${KERNOBJDIR}"
+               fi
+       fi
+
        # Find the version of NetBSD
        #
        DISTRIBVER="$(${HOST_SH} ${TOP}/sys/conf/osrelease.sh)"


Home | Main Index | Thread Index | Old Index