Subject: Re: error: 'REG_STARTEND' undeclared
To: None <current-users@NetBSD.org>
From: Raymond Meyer <raymond.meyer@rambler.ru>
List: current-users
Date: 05/24/2007 23:11:49
This is a multi-part message in MIME format.

--Multipart=_Thu__24_May_2007_23_11_49_+0100_fptS_hS2KmZ_2Yh8
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Thu, 24 May 2007 22:52:19 +0100
Raymond Meyer <raymond.meyer@rambler.ru> wrote:

> Hi, I'm trying to build NetBSD-current on Sparc Solaris, and it fails when it
> tries to build tools:
> 
>  cc -DHAVE_CONFIG_H -I. -I/opt/src/tools/file/../../dist/file/src -I..
> -DMAGIC=\"/opt/tools.sparc64/share/file/magic\" -O
> -c /opt/src/tools/file/../../dist/file/src/softmagic.c -o
> softmagic.o /opt/src/tools/file/../../dist/file/src/softmagic.c: In function
> 'magiccheck': /opt/src/tools/file/../../dist/file/src/softmagic.c:1535:
> error: 'REG_STARTEND' undeclared (first use in this
> function) /opt/src/tools/file/../../dist/file/src/softmagic.c:1535: error:
> (Each undeclared identifier is reported only
> once /opt/src/tools/file/../../dist/file/src/softmagic.c:1535: error: for
> each function it appears in.) *** [softmagic.lo] Error code 1 1 error
> 
> Googling around seems to suggest that REG_STARTEND should be defined
> somewhere in system headers, and it does not exist on Solaris. Looks like
> others had similar problems compiling GNU file on Solaris.
> 
> Could anyone have a look at it and see if it can be fixed so that it builds on
> Solaris?

OK, here is a patch I found on linuxfromscratch website. It fixes the problem
for me, could somebody review and possibly commit it?

--Multipart=_Thu__24_May_2007_23_11_49_+0100_fptS_hS2KmZ_2Yh8
Content-Type: application/octet-stream;
 name="softmagic.c.patch"
Content-Disposition: attachment;
 filename="softmagic.c.patch"
Content-Transfer-Encoding: base64

ZGlmZiAtTmF1ciBmaWxlLTQuMjAub3JpZy9zcmMvc29mdG1hZ2ljLmMgZmlsZS00LjIwL3NyYy9z
b2Z0bWFnaWMuYwotLS0gZmlsZS00LjIwLm9yaWcvc3JjL3Nv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