Bug 97258 - [PATCH] devel/pwlib: [Fix build on FreeBSD 4.x]
Summary: [PATCH] devel/pwlib: [Fix build on FreeBSD 4.x]
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ion-Mihai "IOnut" Tetcu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-14 13:30 UTC by Tod McQuillin
Modified: 2006-05-15 01:02 UTC (History)
1 user (show)

See Also:


Attachments
pwlib-1.10.0_1,1.patch (1.38 KB, patch)
2006-05-14 13:30 UTC, Tod McQuillin
no flags Details | Diff
pwlib-fbsd4.patch (1.41 KB, patch)
2006-05-14 19:25 UTC, Steve Ames
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tod McQuillin 2006-05-14 13:30:17 UTC
The patch to plugins/vidinput_bsd/vidinput_bsd.h doesn't work on
FreeBSD 4.x because sys/types.h must be included before sys/mman.h.

The following patch adds sys/types.h as required.

Port maintainer (steve@energistic.com) is cc'd.

Generated with FreeBSD Port Tools 0.77
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-05-14 13:36:10 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Ion-Mihai "IOnut" Tetcu freebsd_committer freebsd_triage 2006-05-14 13:46:54 UTC
Responsible Changed
From-To: freebsd-ports-bugs->itetcu

I'll take it.
Comment 3 Ion-Mihai "IOnut" Tetcu freebsd_committer freebsd_triage 2006-05-14 16:30:17 UTC
Looks right, build logs here:
http://sce-tindy.tecnik93.com/tb-exp/index.php?action=describe_port&id=520

-- 
IOnut - Un^d^dregistered ;) FreeBSD "user"
  "Intellectual Property" is   nowhere near as valuable   as "Intellect"

Even historians fail to learn from history -- they repeat the same
		-- John Gill, "Patterns of Force", stardate 2534.7

Comment 4 Steve Ames 2006-05-14 19:25:16 UTC
On Sun, May 14, 2006 at 06:30:17PM +0300, Ion-Mihai IOnut Tetcu wrote:
> Looks right, build logs here:
> http://sce-tindy.tecnik93.com/tb-exp/index.php?action=describe_port&id=520
 
Could you try this patch instead? On systems that aren't 4.X then
sys/mman.h includes sys/_types.h. I don't want to explicitly includes
sys/types.h on those systems. The attached patch makes inclusion of
sys/types.h conditional upon freebsd_version being less than 50000.
That number may need to be adjusted somewhat I'm not precisely sure
what the version number was when mman.h started including sys/_types.h.

Question: Does FBSD4 have sys/_types.h? Perhaps that would be more
correct to include than sys/types.h?

Let me know if this works for you.

-steve

> -- 
> IOnut - Un^d^dregistered ;) FreeBSD "user"
>   "Intellectual Property" is   nowhere near as valuable   as "Intellect"
> 
> Even historians fail to learn from history -- they repeat the same
> 		-- John Gill, "Patterns of Force", stardate 2534.7
> 
> 

Comment 5 Tod McQuillin 2006-05-14 21:13:49 UTC
On Sun, 14 May 2006, Ion-Mihai IOnut Tetcu wrote:

> Looks right, build logs here:
> http://sce-tindy.tecnik93.com/tb-exp/index.php?action=describe_port&id=520

On my 4.11-STABLE system, without the patch I submitted, the build fails 
as follows (complete log here: http://distalzou.net/tmp/pwlib-build.txt)

gmake[4]: Entering directory 
`/usr/src/ports/devel/pwlib/work/pwlib_v1_10_0/plugins/vidinput_bsd'
mkdir -p ../pwlib/device/videoinput
g++ -O -pipe  -O1 -I/usr/src/ports/devel/pwlib/work/pwlib_v1_10_0/include 
-I/usr/local/include  -DP_USE_PRAGMA -D_REENTRANT -pthread -Wall  -g 
-D_DEBUG -DNDEBUG -I/usr/src/ports/devel/pwlib/work/pwlib_v1_10_0/include 
\
  \
-I. -shared vidinput_bsd.cxx -o 
../pwlib/device/videoinput/bsdvideo_pwplugin.so
In file included from vidinput_bsd.h:9,
                  from vidinput_bsd.cxx:124:
/usr/include/sys/mman.h:141: type specifier omitted for parameter
/usr/include/sys/mman.h:144: type specifier omitted for parameter
/usr/include/sys/mman.h:147: type specifier omitted for parameter
/usr/include/sys/mman.h:147: type specifier omitted for parameter
/usr/include/sys/mman.h:149: type specifier omitted for parameter
/usr/include/sys/mman.h:150: type specifier omitted for parameter
/usr/include/sys/mman.h:151: type specifier omitted for parameter
/usr/include/sys/mman.h:152: type specifier omitted for parameter
/usr/include/sys/mman.h:154: type specifier omitted for parameter
/usr/include/sys/mman.h:155: type specifier omitted for parameter
/usr/include/sys/mman.h:156: type specifier omitted for parameter
vidinput_bsd.cxx: In method `BOOL 
PVideoInputDevice_BSDCAPTURE::GetFrameDataNoDelay(BYTE *, PINDEX * = 0)':
/usr/include/sys/mman.h:147: too many arguments to function `void * 
mmap(void *, int, int, int)'
vidinput_bsd.cxx:414: at this point in file
vidinput_bsd.cxx: In method `void 
PVideoInputDevice_BSDCAPTURE::ClearMapping()':
/usr/include/sys/mman.h:152: too many arguments to function `int 
munmap(void *)'
vidinput_bsd.cxx:458: at this point in file

-- 
Tod McQuillin
Comment 6 Tod McQuillin 2006-05-14 21:29:14 UTC
On Sun, 14 May 2006, Steve Ames wrote:

> Could you try this patch instead? On systems that aren't 4.X then
> sys/mman.h includes sys/_types.h. I don't want to explicitly includes
> sys/types.h on those systems. The attached patch makes inclusion of
> sys/types.h conditional upon freebsd_version being less than 50000.
> That number may need to be adjusted somewhat I'm not precisely sure
> what the version number was when mman.h started including sys/_types.h.

Looks like RELENG_5_0 was the first release tag to include this, so 500000 
seems right to me.

> Question: Does FBSD4 have sys/_types.h? Perhaps that would be more
> correct to include than sys/types.h?

No, it doesn't have sys/_types.h, this was first added in 5.0

> Let me know if this works for you.

Yes, this patch works fine, thanks very much.
-- 
Tod McQuillin
Comment 7 Steve Ames 2006-05-14 22:26:03 UTC
On Mon, May 15, 2006 at 05:29:14AM +0900, Tod McQuillin wrote:
> On Sun, 14 May 2006, Steve Ames wrote:
> 
> >Could you try this patch instead? On systems that aren't 4.X then
> >sys/mman.h includes sys/_types.h. I don't want to explicitly includes
> >sys/types.h on those systems. The attached patch makes inclusion of
> >sys/types.h conditional upon freebsd_version being less than 50000.
> >That number may need to be adjusted somewhat I'm not precisely sure
> >what the version number was when mman.h started including sys/_types.h.
> 
> Looks like RELENG_5_0 was the first release tag to include this, so 500000 
> seems right to me.
> 
> >Question: Does FBSD4 have sys/_types.h? Perhaps that would be more
> >correct to include than sys/types.h?
> 
> No, it doesn't have sys/_types.h, this was first added in 5.0
> 
> >Let me know if this works for you.
> 
> Yes, this patch works fine, thanks very much.

Right then. Patch approved. Please commit when possible.

-steve
Comment 8 Ion-Mihai "IOnut" Tetcu freebsd_committer freebsd_triage 2006-05-15 01:02:42 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!