Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 283751 - dev-libs/xmlrpc-c-1.06.27 does not compile on freebsd without USE="threads", patch attached
Summary: dev-libs/xmlrpc-c-1.06.27 does not compile on freebsd without USE="threads", ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: x86 FreeBSD
: High normal (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-05 13:46 UTC by Henning Schild
Modified: 2011-10-01 21:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xmlrpc-c-1.27.05-freebsd.patch (xmlrpc-c-1.27.05-freebsd.patch,469 bytes, patch)
2011-09-12 08:28 UTC, Peter Volkov (RETIRED)
Details | Diff
xmlrpc-c-1.27.05-freebsd-v.1.patch (xmlrpc-c-1.27.05-freebsd-v.1.patch,336 bytes, patch)
2011-09-12 08:29 UTC, Peter Volkov (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Henning Schild 2009-09-05 13:46:27 UTC
dev-libs/xmlrpc-c-1.06.27 library includes main.h which seems to be sys/wait.h on freebsd, at least changing this include makes it compile

Reproducible: Always

Steps to Reproduce:
1. "USE="-threads" ebuild /usr/portage/dev-libs/xmlrpc-c/xmlrpc-c-1.06.27.ebuild compile" on gfbsd system

Actual Results:  
...
thread_fork.c:6:18: error: wait.h: No such file or directory
thread_fork.c: In function 'ThreadWaitAndRelease':
thread_fork.c:240: warning: implicit declaration of function 'waitpid'
gmake[3]: *** [thread_fork.lo] Error 1
gmake[3]: Leaving directory `/var/tmp/portage/dev-libs/xmlrpc-c-1.06.27/work/xmlrpc-c-1.06.27/lib/abyss/src'
...

Expected Results:  
should compile
Comment 1 Henning Schild 2009-09-05 13:47:48 UTC
--- /usr/portage/dev-libs/xmlrpc-c/xmlrpc-c-1.06.27.ebuild      2009-04-05 10:08:24 +0200
+++ /usr/local/portage/portage/dev-libs/xmlrpc-c/xmlrpc-c-1.06.27.ebuild        2009-08-28 07:52:21 +0200
@@ -11,7 +11,7 @@
 HOMEPAGE="http://xmlrpc-c.sourceforge.net/"
 
 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
-IUSE="+curl threads"
+IUSE="+curl threads kernel_FreeBSD"
 LICENSE="BSD"
 SLOT="0"
 
@@ -40,6 +40,11 @@
        # Respect the user's CFLAGS/CXXFLAGS.
        sed -i -e "/CFLAGS_COMMON/s:-g -O3$:${CFLAGS}:" Makefile.common
        sed -i -e "/CXXFLAGS_COMMON/s:-g$:${CXXFLAGS}:" Makefile.common
+
+       if use kernel_FreeBSD
+       then
+               sed -i -e "s/wait\.h/sys\/wait\.h/" lib/abyss/src/thread_fork.c
+       fi
 }
 
 src_compile() {
Comment 2 Naohiro Aota gentoo-dev 2009-11-12 10:18:30 UTC
Worked for me on FreeBSD Gentoo 7.1-r1.

Comment 3 Henning Schild 2009-11-23 09:10:48 UTC
Then please provide more information. Like where the header is located on your system and which package owns it.
Comment 4 Naohiro Aota gentoo-dev 2009-11-24 11:12:04 UTC
Sorry, maybe I've made you confused. I had had the same problem, and I
meant that your patch worked also for me. I really want this patch
applied to portage.
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2011-09-12 08:28:32 UTC
Created attachment 286209 [details, diff]
xmlrpc-c-1.27.05-freebsd.patch

Um no. I prefer correct code fix then this.

@BSD, is there any way to detect that we are on FreeBSD system during compilation?

In this link BSD, __FreeBSD__ are mentioned:
http://www.freebsd.org/doc/en/books/porters-handbook/porting-versions.html

One solution is to use patch in attachment.
Comment 6 Peter Volkov (RETIRED) gentoo-dev 2011-09-12 08:29:17 UTC
Created attachment 286211 [details, diff]
xmlrpc-c-1.27.05-freebsd-v.1.patch

That said, I prefer this patch. I'll try to contact upstream on this issue.
Comment 7 Naohiro Aota gentoo-dev 2011-09-16 02:52:49 UTC
(In reply to comment #6)
> Created attachment 286211 [details, diff]
> xmlrpc-c-1.27.05-freebsd-v.1.patch
> 
> That said, I prefer this patch. I'll try to contact upstream on this issue.

Seems nice. That should be work also on Linux. (I just noticed wait.h just include sys/wait.h lol)
Comment 8 Alexis Ballier gentoo-dev 2011-09-16 13:01:05 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Created attachment 286211 [details, diff]
> > xmlrpc-c-1.27.05-freebsd-v.1.patch
> > 
> > That said, I prefer this patch. I'll try to contact upstream on this issue.
> 
> Seems nice. That should be work also on Linux. (I just noticed wait.h just
> include sys/wait.h lol)

wait.h shouldnt exist at all and isnt standard; sys/wait.h should always be used instead. glibc installs wait.h only for historical reasons afaik.
Comment 9 Peter Volkov (RETIRED) gentoo-dev 2011-10-01 21:41:05 UTC
Fixed in xmlrpc-c-1.28.00.