I was having problems compiling latest cfengine (2.2.7) on Windows under the
latest build of cygwin (1.5.25).
With the help of a skilled colleague (thanks, Jared) we were able to get it
to compile after making the changes below.
 
ERROR #1:
gcc -DHAVE_CONFIG_H -I. -I/usr/include/db4 -I/usr/include   -g -O2
-Wreturn-type -Wmissing-prototypes -Wuninitialized  -g -O2
-I/usr/include/db4 -g -O2 -I/usr/include/db4 -MT do.o -MD -MP -MF
.deps/do.Tpo -c -o do.o do.c
do.c: In function `CheckTimeZone':
do.c:2732: error: called object is not a function
 
SOLUTION:
change line 2732 in do.c
from:
   strcpy(tz,timezone());
to:
   strcpy(tz,_timezone);
 
-----
 
ERROR #2:
gcc -DHAVE_CONFIG_H -I. -I/usr/include/db4 -I/usr/include   -g -O2
-Wreturn-type -Wmissing-prototypes -Wuninitialized  -g -O2
-I/usr/include/db4 -g -O2 -I/usr/include/db4 -MT cfexecd.o -MD -MP -MF
.deps/cfexecd.Tpo -c -o cfexecd.o cfexecd.c
cfexecd.c: In function `StartServer':
cfexecd.c:232: warning: initialization makes pointer from integer without a
cast
cfexecd.c:320: error: `_P_NOWAIT' undeclared (first use in this function)
cfexecd.c:320: error: (Each undeclared identifier is reported only once
cfexecd.c:320: error: for each function it appears in.)
 
SOLUTION:
added the following lines to the end of cf.defs.h (we weren't sure where
these belonged)
#ifndef _P_WAIT
# define _P_WAIT 0
# define _P_NOWAIT 1
# define _P_OVERLAY 2
# define _P_NOWAITO 3
# define _P_DETACH 4
# define WAIT_CHILD 0
# define WAIT_GRANDCHILD 1
#endif
 
After making these 2 changes, make completes compile without any errors.
Since I'm new to the list I'm not sure the proper procedure/format for
submitting patches, but I have attached them to this message. Perhaps
someone in the know can put them in the proper spot.
Thanks,
 
Rob Brown
 
 

Attachment: do.c.patch
Description: Binary data


Attachment: cf.defs.h.patch
Description: Binary data

_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to