bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] FW: inetutils-1.5 build feedback


From: Alfred M. Szmidt
Subject: Re: [bug-inetutils] FW: inetutils-1.5 build feedback
Date: Thu, 26 Oct 2006 08:22:29 +0200 (CEST)

[Resending again, sorry for the dupe.  Please don't remove
address@hidden from the CC list.]

Could you try the following?  It should fix the sig_t breakage on all
platforms.

2006-10-26  Alfred M. Szmidt  <address@hidden>

        * configure.ac: Check for sighandler_t and __sighandler_t.
        * libinetutils/setsig.c (SIGHANDLER_T): New macro.
        Use it in function declarations.

--- configure.ac        21 Oct 2006 18:12:26 +0200      1.33
+++ configure.ac        26 Oct 2006 07:55:52 +0200      
@@ -477,8 +478,10 @@ AC_CHECK_TYPES(struct if_nameindex, , ,
    #include <sys/socket.h>
    #include <net/if.h>])
 
-dnl sig_t is the type of a signal handler (4.4BSD)
-AC_CHECK_TYPES(sig_t, , ,
+dnl sighandler_t is the type of the signal handler on GNU variants,
+dnl sig_t is the type of a signal handler on 4.4BSD's,
+dnl other systems use __sighandler_t.
+AC_CHECK_TYPES([sighandler_t, sig_t, __sighandler_t], , ,
   [#include <sys/types.h>
    #include <signal.h> ])
 
--- libinetutils/setsig.c       21 Oct 2006 17:04:04 +0200      1.3
+++ libinetutils/setsig.c       26 Oct 2006 08:04:18 +0200      
@@ -28,10 +28,20 @@
 
 #include <signal.h>
 
+#ifdef HAVE_SIGHANDLER_T
+# define SIGHANDLER_T sighandler_t
+#elif HAVE_SIG_T
+# define SIGHANDLER_T sig_t
+#elif HAVE___SIGHANDLER_T
+# define SIGHANDLER_T __sighandler_t
+#else
+# error "unknown sighandler type, please report this to <address@hidden>"
+#endif
+
 /* This is exactly like the traditional signal function, but turns on the
    SA_RESTART bit where possible.  */
-sig_t
-setsig (int sig, sig_t handler)
+SIGHANDLER_T
+setsig (int sig, SIGHANDLER_T handler)
 {
 #ifdef HAVE_SIGACTION
   struct sigaction sa;

   >>    
========================================================================
   >>    Machinetype:            Apple Power Mac G4 (2 1420 MHz PowerPC G4 (3.3)
   >>    CPUs, 2GB RAM); Darwin 7.9.0 (Mac OS X Server 10.3.9 (7W98))
   >>    Configure environment:  CC=gcc CXX=g++   LIBS=-lcc_dynamic
   >>
   >>    gcc  -g -O2   -o telnetd  telnetd.o pty.o term.o utility.o state.o
   >>    termstat.o slc.o -L../libinetutils -linetutils -L../libtelnet -ltelnet
   >>    -L../lib -lgnu -lcurses     -lresolv -lcc_dynamic
   >>    /usr/bin/ld: warning table of contents of library:
   >>    ../libinetutils/libinetutils.a not sorted slower link editing will 
result
   >>    (use the ranlib(1) -s option)
   >>    /usr/bin/ld: Undefined symbols:
   >>    _endutent
   >>    _pututline
   >>    _getutline
   >>
   >> Where are these symbols defined on this platform?
   >> ...

It occured to me that this (probobly!) got fixed by one of the patches
I commited.  pututline is the old version of pututxline.

   >>    "/usr/include/sys/socket.h", line 61: warning: typedef declares no 
type name
   >>
   >> This looks more like a bug on this platform, is there a specific order
   >> in which <sys/socket.h> must be included? The documentation will
   >> probobly state this.
   >> ...

   I trapped the preprocessor output to see what is happening: the source
   code line from /usr/include/sys/socket.h:52

           typedef uint16_t     sa_family_t;

   becomes the erroneous

           typedef  unsigned short int   unsigned int ;

Ah, lovley.  Is sa_family_t defined anywhere on this platform
(whatever the platform was, Solaris I think)?

   I have just pulled over the CVS tree from
   http://cvs.savannah.gnu.org/viewcvs/inetutils/, and have restarted
   builds on the two systems for which you applied patches.

A good way to test everything in one go is to pass -k to make, that
way all build errors will show up in one go.

Thank you for the detailed descriptions, much apperciated.  Happy
hacking!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]