devel/commoncpp problems

Jeff Mitchell jam6 at cec.wustl.edu
Sat Mar 27 23:40:09 PST 2004


I think devel/commoncpp is broken (okay, or something on my computer is).  It's one of many ports that fail during portupgrade, and I think several of the other ports are depending upon it, so that might be part of the problem I'm having.  There are a couple things here of note with devel/commoncpp that I wanted to ask about.

First, the stuff I could fix.  I was getting some errors during configuration.  The relevant lines in config.log are:

/usr/include/pthread_np.h:46: error: syntax error before '*' token
/usr/include/pthread_np.h:47: error: syntax error before '*' token
/usr/include/pthread_np.h:51: error: syntax error before '*' token
/usr/include/pthread_np.h:54: error: syntax error before "const"


/usr/include/sys/sched.h: In function `sched_pin':
/usr/include/sys/sched.h:106: error: `curthread' undeclared (first use in this function)
/usr/include/sys/sched.h:106: error: (Each undeclared identifier is reported only once
/usr/include/sys/sched.h:106: error: for each function it appears in.)
/usr/include/sys/sched.h: In function `sched_unpin':
/usr/include/sys/sched.h:112: error: `curthread' undeclared (first use in this function)

/usr/include/netinet/ip.h:71: error: field `ip_src' has incomplete type
/usr/include/netinet/ip.h:71: error: field `ip_dst' has incomplete type
/usr/include/netinet/ip.h:164: error: syntax error before "n_long"
/usr/include/netinet/ip.h:166: error: field `ipt_addr' has incomplete type
/usr/include/netinet/ip.h:167: error: syntax error before "n_long"

I fixed these problems (at least, the configure script no longer asked me to notify someone of the bugs) by doing the following.  What I did may or may not have been bad, so if someone has a better idea, please let me know:
Adding the line
#include "/usr/include/pthread.h" 
to /usr/include/pthread_np.h fixed the first one.
Similarly, adding
#include "/usr/include/sys/pcpu.h"
and
#include "usr/include/netinet/in.h"

fixed the second and third issues respectively.

Now, what I can't fix.  I'm still getting the same errors during the build that I was getting before (when the configure script was giving me angry warnings).  The errors are as follows:

poprocks# make
===>  Building for commoncpp2-1.1.0,1
Making all in include
gmake[1]: Entering directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/include'
gmake  all-recursive
gmake[2]: Entering directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/include'
Making all in cc++
gmake[3]: Entering directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/include/cc++'
gmake[3]: Nothing to be done for `all'.
gmake[3]: Leaving directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/include/cc++'
gmake[3]: Entering directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/include'
gmake[3]: Nothing to be done for `all-am'.
gmake[3]: Leaving directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/include'
gmake[2]: Leaving directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/include'
gmake[1]: Leaving directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/include'
Making all in src
gmake[1]: Entering directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/src'
if /bin/sh ../libtool --mode=compile c++ -DHAVE_CONFIG_H -I. -I. -I../include   -I/usr/local/include -I../src -DCCXX_EXPORT_LIBRARY -D_THREAD_SAFE -I/usr/local/include/libxml2 -I/usr/local/include -I../include -O -pipe -mcpu=pentiumpro -I/usr/local/include -D_GNU_SOURCE -MT thread.lo -MD -MP -MF ".deps/thread.Tpo" \
  -c -o thread.lo `test -f 'thread.cpp' || echo './'`thread.cpp; \
then mv -f ".deps/thread.Tpo" ".deps/thread.Plo"; \
else rm -f ".deps/thread.Tpo"; exit 1; \
fi
 c++ -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/local/include -I../src -DCCXX_EXPORT_LIBRARY -D_THREAD_SAFE -I/usr/local/include/libxml2 -I/usr/local/include -I../include -O -pipe -mcpu=pentiumpro -I/usr/local/include -D_GNU_SOURCE -MT thread.lo -MD -MP -MF .deps/thread.Tpo -c thread.cpp  -fPIC -DPIC -o .libs/thread.o
thread.cpp: In static member function `static void ost::Thread::yield()':
thread.cpp:1081: error: `pthread_yield' undeclared (first use this function)
thread.cpp:1081: error: (Each undeclared identifier is reported only once for 
   each function it appears in.)
gmake[1]: *** [thread.lo] Error 1
gmake[1]: Leaving directory `/usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/src'
gmake: *** [all-recursive] Error 1
*** Error code 2

Stop in /usr/ports/devel/commoncpp.

I have no idea, after poking around for two hours, why it thinks pthread_yield is not declared.  /usr/ports/devel/commoncpp/work/commoncpp2-1.1.0/include/cc++/config.h has the following:

/* has yield */
#define HAVE_PTHREAD_YIELD 1

so it's not redefining pthread_yield to sched_yield.  This, I think, is fine, because obviously the configure script found pthread_yield.

Also, the command above that actually compiles thread.cpp includes the /usr/local/include directory.  The pthread.h in there only defines pthread_yield if _POSIX_BACKCOMPAT is defined, so maybe that is the problem, except if I try including (in thread.h in the commoncpp work)

#include "/usr/include/pthread.h"

which defines pthread_yield no matter what (at least I think), it still doesn't work.  Possibly it's bad to do that anyways, but I honestly don't know what the difference is between /usr/include and /usr/local/include, and why there are files in the two with the same names that are very different.

Anyways, any help would be much appreciated.

Thanks,
Jeff


More information about the freebsd-ports mailing list