[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-inetutils] compiling inetutils on AIX 51
From: |
Stuefe, Thomas |
Subject: |
[bug-inetutils] compiling inetutils on AIX 51 |
Date: |
Thu, 24 Apr 2003 14:23:11 +0200 |
Hi all!
I'm trying to compile the inetutils on AIX 5.1. I found several issues:
1) in libinetutils/ttymsg.c, line 136
I had to replace
(char*)iov->iov_base += wret;
with
iov->iov_base = (char *)iov->iov_base + wret;
On AIX, using xlC, a cast is not an lvalue. I'm not sure, but I always thought
that standard ANSI behaviour.
2) in telnetd/telnetd.h, you use the macro P for parameter lists.
The functions net_output_data and debug_output_data are implemented in
utility.c and defined in telnetd.h, using this P macro. Now, if that expands to
nothing, the function declaration differs for those two functions between
utility.c and telnetd.h. It seems that the xlC does not allow declaration
of functions with empty parameter lists if that parameter lists contains
variable parameter lists...
I fixed it for me by removing the P macro in the header for those two functions:
replacing
int net_output_data P((const char *format,...));
with
int net_output_data(const char *format,...);
and
extern void debug_output_data P((const char *fmt, ...));
with
extern void debug_output_data (const char *fmt, ...);
Dunno whether this is a good solution, though.
3) we don't seem to have error.h on AIX, so as a quick workaround I put a
static fake error (..) function into xmalloc.c.
4) AIX has setenv(), but not unsetenv ().
To fix this, I did:
4.1) in libinetutils/Makefile, I added setenv.o to the module list of
am_libinetutils_a_OBJECTS. That way, the object setenv.o is always part of that
library.
4.2) I introduced a flag HAVE_UNSETENV in config.h, right beside HAVE_SETENV.
HAVE_SETENV would be 1 on AIX, HAVE_UNSETENV would be not defined.
4.3) In libinetutils/setenv.c, I enclosed the setenv() implementation with
ifndef HAVE_SETENV
4.3) In libinetutils/setenv.c, I enclosed the unsetenv() implementation with
ifndef HAVE_UNSETENV
That way, I can use the setenv() function from the C-Runtime and the unsetenv
function from libinetutils/setenv.c.
Tell me what you think about it. Is there a way/does it make sense to add part
of it (e.g. point 4) to your official sources?
Bye, Thomas Stuefe
-------------------------
Thomas Stüfe
IBM AS/400 Porting Team
SAP Germany
-------------------------
- [bug-inetutils] compiling inetutils on AIX 51,
Stuefe, Thomas <=