problems compiling 0.4.9 on slackware system

Eric Z. Ayers Eric.Ayers@intec-telecom-systems.com
Tue, 17 Apr 2001 08:02:38 -0400 (EDT)


It looks like in the CVS version, another patch was made that
accomplishes a similar thing...  heartbeat.c also uses CLK_TCK, but
didn't include the little stanza below. I just updated heartbeat.c  in
the CVS version. 


Index: hb_api.c
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/hb_api.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -c -r1.24 -r1.25
*** hb_api.c	2000/11/12 04:29:22	1.24
--- hb_api.c	2001/04/06 19:35:45	1.25
***************
*** 75,82 ****
--- 75,95 ----
  #include <hb_api_core.h>
  #include <sys/stat.h>
  #include <sys/time.h>
+ #include <time.h>
  #include <unistd.h>
  
+ /* 
+  * Just incase we are on an out of date system 
+  */
+ #ifndef CLOCKS_PER_SEC
+ #  ifndef CLK_TCK
+ #    error Neither CLOCKS_PER_SEC nor CLK_TCK (obsolete) are defined
+ #  endif /* CLK_TCK */
+ #  define CLOCKS_PER_SEC CLK_TCK
+ #endif /* CLOCKS_PER_SEC */
+ 
+ 
+ 
  static int api_ping_iflist(const struct ha_msg* msg, struct node_info * node
  ,	struct ha_msg* resp
  ,	client_proc_t* client, const char** failreason);
***************
*** 205,211 ****
  	}
  
  	lastnow = now;
! 	audittime = now + (CLK_TCK * 10); /* Every 10 seconds */
  
  	for (client=client_list; client != NULL; client=nextclient) {
  		nextclient=client->next;
--- 218,224 ----
  	}
  
  	lastnow = now;
! 	audittime = now + (CLOCKS_PER_SEC * 10); /* Every 10 seconds */
  
  	for (client=client_list; client != NULL; client=nextclient) {
  		nextclient=client->next;


Luis Claudio R.Goncalves writes:
 > On Fri, Apr 13, 2001 at 05:03:50PM -0700, David Lang wrote:
 > | I am attempting to compile on a slackware system, libc 2.2.2
 > | (slackware-current as of Feb 28) and get an error saying that CLK_TCK was
 > | used but not defined.
 > | 
 > | where should CLK_TCK have been defined?
 > 
 > Hi!
 > 
 >    This is Glibc 2.2 related. The fix below shoul solve the problem.
 > 
 > --------------------------cut here------------------------
 > diff -ruN heartbeat-0.4.8l/heartbeat/hb_api.c
 > heartbeat-0.4.8l.nsc/heartbeat/hb_api.c
 > --- heartbeat-0.4.8l/heartbeat/hb_api.c Sat Nov 11 18:05:50 2000
 > +++ heartbeat-0.4.8l.nsc/heartbeat/hb_api.c     Thu Mar  1 18:01:28 2001
 > @@ -74,7 +74,11 @@
 >  #include <hb_api.h>
 >  #include <hb_api_core.h>
 >  #include <sys/stat.h>
 > +#if defined(__GLIBC__) && ( __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 )
 >  #include <sys/time.h>
 > +#else
 > +#include <time.h>
 > +#endif
 >  #include <unistd.h>
 > 
 >  static int api_ping_iflist(const struct ha_msg* msg, struct node_info *node
 > --------------------------cut here------------------------
 > 
 > 
 > -- 
 > [ Luis Claudio R. Goncalves                  lclaudio@conectiva.com.br ]
 > [ MSc coming soon -- Conectiva HA Team -- Gospel User -- Linuxer -- :) ]
 > [ Fault Tolerance - Real-Time - Distributed Systems - IECLB - IS 40:31 ]
 > [ LateNite Programmer --  Jesus Is The Solid Rock On Which I Stand  -- ]
 > 
 > ------------------------------------------------------------------------------
 > Linux HA Web Site:
 >   http://linux-ha.org/
 > Linux HA HOWTO:
 >   http://metalab.unc.edu/pub/Linux/ALPHA/linux-ha/High-Availability-HOWTO.html
 > ------------------------------------------------------------------------------
--
Eric Z. Ayers				              Lead Software Engineer
Phone:  +1 404-705-2864                    Computer Generation, Incorporated
Fax:    +1 404-705-2805                     an Intec Telecom Systems Company
Web:    http://www.intec-telecom-systems.com/
Email:  eric.ayers@intec-telecom-systems.com
Postal: Bldg G 4th Floor, 5775 Peachtree-Dunwoody Rd, Atlanta, GA 30342 USA