Skip to contentSkip to conversation

compilation problems + other help

DISCUSSION Loz 1 participant 1 message Aug 3, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 200207261031.20342@.

Loz

author
#1 lore raw
Quoted 15 lines · Payal

Hi,
I downloaded diald-1.0 2 days back. Then I untarred it and configured it using command, #./configure
Then I did make and got the following error.
#make
gcc -g -O2 -DHAVE_CONFIG_H -I.

(quoted diff) +0 -3
-DDIALD_CONFIG_FILE=\"/usr/local/etc/diald.conf\" 
-DDIALD_DEFS_FILE=\"/usr/local/lib/diald/diald.defs\" 
-DRUN_PREFIX=\"/usr/local/var/run\"   -c -o diald.o diald.c

diald.c: In function `main':
diald.c:192: `CLK_TCK' undeclared (first use in this function) diald.c:192: (Each undeclared identifier is reported only once diald.c:192: for each function it appears in.)
make: *** [diald.o] Error 1

Quoted 1 line

What can i do about it?

This patch appeared on the mailing list a while back. I'm not sure if it will help you or not...

cheers

Loz

Here are a couple of patches for diald-1.0.

If autoconf defines both
HAVE_SYS_TIME_H and TIME_WITH_SYS_TIME
then *both* sys/time.h and time.h should be included, but diald-1.0 fails to also include time.h, which defines CLK_TCK. (older diald did include both)

Fixing this on a RedHat 7.x system (where both get defined) fixes the undefined CLK_TCK problem in diald.c, without messing with diald.c

So this may be the "correct" fix to the problem, rather than changing #if CLK_TCK to #ifdef CLK_TCK in diald.c

the fix is now in diald.h:
--------------------------------------------------

diald.h Fri Sep 7 02:57:56 2001 renamed from diald.h Sat Jun 16 12:01:25 2001 +5 -0
diff -uNr diald-1.0/diald.h diald-1.0-patched/diald.h
@@ -29,6 +29,11 @@
 #include <signal.h>
 #if HAVE_SYS_TIME_H
 #  include <sys/time.h>
+#if TIME_WITH_SYS_TIME
+#  include <time.h>
+#endif
+#else
+#  include <time.h>
 #endif
 #ifdef _POSIX_PRIORITY_SCHEDULING
 #  include <sched.h>

----------------------------------------------------

(2) A compiler warning in timer.c is generated because the arguments of the functions del_impulse() and del_connection()
in firewall.c should be passed as void * , and then be cast to FW_unit * and FW_connection *, respectively.

This is fixed by the second attached patch

----------------------------------
E-Mail: [email protected]
Date: 12-Jan-2002
Time: 14:35:12

This message was sent by XFMail
----------------------------------

diald.h +2 -2
diff -uNr diald-1.0/diald.h diald-1.0-void/diald.h
@@ -488,6 +488,6 @@
 int getprotocol(const char *name);
 char *getprotonumber(int proto);
 int getsn(FILE *fp,char *buf,int len);
-void del_impulse(FW_unit *unit);
-void del_connection(FW_Connection *c);
+void del_impulse(void *unit);
+void del_connection(void *c);
 void slip_start_fail(void * data);
firewall.c +6 -7
diff -uNr diald-1.0/firewall.c diald-1.0-void/firewall.c
@@ -24,8 +24,6 @@
 int impulse_time = 0;
 int impulse_fuzz = 0;
 
-void del_connection(FW_Connection *);
-
 /*
  * Initialize the units.
  */
@@ -69,7 +67,7 @@
 #if 0
     mon_syslog(LOG_DEBUG,"slot def: %d %d %x %x %x",
 	slot->start, slot->end, slot->wday, slot->mday, slot->month);
-#endif 0
+#endif 
 	if ((slot->start <= ctime)
 	&&  (ctime <= slot->end)
 	&&  (slot->wday & (1<<ltime->tm_wday))
@@ -370,7 +368,7 @@
 	} else {
 	    /* timeout = 0, so toss the connection */
 	    del_timer(&c->timer);
-	    del_connection(c);
+	    del_connection((void *)c);
 	}
     }
 }
@@ -379,8 +377,9 @@
  * Get a connection out of a queue.
  */
 
-void del_connection(FW_Connection *c)
+void del_connection(void *c_void )
 {
+    FW_Connection *c = (FW_Connection *) c_void;
     if (debug&DEBUG_CONNECTION_QUEUE)
 	mon_syslog(LOG_DEBUG,"Deleting connection %p @ %ld",c,time(0));
 
@@ -390,9 +389,9 @@
     free(c);
 }
 
-void del_impulse(FW_unit *unit)
+void del_impulse(void  *unit_void)
 {
-
+    FW_unit *unit = (FW_unit *) unit_void;
     if (unit->impulse_mode) {
 	unit->impulse_mode = 0;
 	if (impulse_time > 0) {
diald.h +5 -0
diff -uNr diald-1.0/diald.h diald-1.0-patched/diald.h
@@ -29,6 +29,11 @@
 #include <signal.h>
 #if HAVE_SYS_TIME_H
 #  include <sys/time.h>
+#if TIME_WITH_SYS_TIME
+#  include <time.h>
+#endif
+#else
+#  include <time.h>
 #endif
 #ifdef _POSIX_PRIORITY_SCHEDULING
 #  include <sched.h>