Sender: drt@c0re.rc23.cx To: felix@fefe.de Subject: libowfat 0.7 on MacOS X From: drt@un.bewaff.net (Doobee R. Tzeck) Date: 15 Oct 2001 11:10:00 +0200 Message-ID: <87ofn9gtg7.fsf@c0re.rc23.cx> Gcc: nnfolder+archive:mail.2001-10 --text follows this line-- Meckermeckermecker ;-) 1) das soll wohl nicht in den tarball: -rw-r--r-- 1 md staff 2089 May 12 05:13 .#buffer.h.1.4 2) uint16.h will endian.h Dsa gibt es bei MaxOS X nicht. Bei FreeBSD so auch nicht, sondern nur Bernstein Paket: /home/drt/src/sigs-0.50/endian.h1 /home/drt/src/sigs-0.50/endian.h2 Kernel: /usr/include/machine/endian.h /usr/include/netatalk/endian.h NO_UINT16_MACROS und NO_UINT32_MACROS hilft. Wofuer ist denn dieses endian.h? Die *.c files ignorieren das doch, oder verstehe ich da was falsch? Duerfte ich als konservativen Default CFLAGS=-I. -pipe -Wall -O -Wall -DNO_UINT16_MACROS -DNO_UINT32_MACROS im Makefile vorschlagen, dann ist das ganze einigermassen portabel. 3) __THROW kann mein Compiler nicht. '-D__THROW=' hilft, ist aber abscheulich. 4) socket/socket_accept6.c und andere wollen #include "error.h", gibts aber nicht. Liegt vermutlich in ../dietlibc/include, aber eigentlich sollte liblowfat doch auch ohne dietlibc gehen. Auskommentieren hat geholfen. 5) #include muss man vor #include machen, jedenfalls auf MacOS X 6) EPROTO gibt es nicht auf MacOS X (!), sondern EPROTONOSUPPORT 7) gnarf! "getpeername: glibc 2.0.0 through 2.0.4 need size_t * here, where 2.0.5 needs socklen_t *", FreeBSD will auch socklen_t und MacOS X int. Int sollte es aber auf jeden Fall tun, man koennte aber auch ein #ifdef nehmen. 8) Der dumme Mac OS X ld braucht einen ranlib durchlauf bevor er taetig wird. 9) Dann gibt es noch ein Warning, dass mich ratlos macht: ranlib libowfat.a ranlib: same symbol defined in more than one member in: libowfat.a (table of contents will not be sorted) ranlib: file: libowfat.a(mmap_private.o) defines symbol: _mmap_private ranlib: file: libowfat.a(mmap_shared.o) defines symbol: _mmap_private Hier der patch, der libowfat unter MaxOS X 10.0.4 compillierbar macht: see http://www.fefe.de/libowfat/ diff -u -r libowfat-orig/Makefile libowfat/Makefile --- libowfat-orig/Makefile Wed Aug 15 19:25:30 2001 +++ libowfat/Makefile Mon Oct 15 11:46:31 2001 @@ -3,8 +3,8 @@ VPATH=str:byte:fmt:scan:uint:open:stralloc:unix:socket:buffer:mmap CC=gcc -#CFLAGS=-I. -pipe -Wall -Os -march=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall -CFLAGS=-I. -I../dietlibc/include -pipe -Wall -Os -malign-functions=2 -fschedule-insns2 -g +CFLAGS=-I. -pipe -Wall -O -Wall -DNO_UINT16_MACROS -DNO_UINT32_MACROS -D__THROW= +#CFLAGS=-I. -I../dietlibc/include -pipe -Wall -Os -malign-functions=2 -fschedule-insns2 -g #CFLAGS=-I../dietlibc/include -I. -pipe -Wall -Os -march=pentiumpro -mcpu=athlon -fomit-frame-pointer -fschedule-insns2 -Wall #CFLAGS=-I../dietlibc/include -pipe -Os -march=pentiumpro -mcpu=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall @@ -48,6 +48,7 @@ %.a: ar cr $@ $^ + ranlib $@ t: t.o socket.a stralloc.a fmt.a scan.a uint.a mmap.a open.a buffer.a \ str.a byte.a diff -u -r libowfat-orig/socket/socket_accept4.c libowfat/socket/socket_accept4.c --- libowfat-orig/socket/socket_accept4.c Mon Feb 5 19:24:29 2001 +++ libowfat/socket/socket_accept4.c Mon Oct 15 11:18:23 2001 @@ -1,3 +1,4 @@ +#include #include #include #include "socket.h" diff -u -r libowfat-orig/socket/socket_accept6.c libowfat/socket/socket_accept6.c --- libowfat-orig/socket/socket_accept6.c Mon Feb 5 19:25:24 2001 +++ libowfat/socket/socket_accept6.c Mon Oct 15 11:25:23 2001 @@ -5,7 +5,7 @@ #include "socket.h" #include "ip6.h" #include "haveip6.h" -#include "error.h" +/* #include "error.h" not needed ??? */ int socket_accept6(int s,char ip[16],uint16 *port,uint32 *scope_id) { diff -u -r libowfat-orig/socket/socket_bind4.c libowfat/socket/socket_bind4.c --- libowfat-orig/socket/socket_bind4.c Mon Feb 5 18:42:47 2001 +++ libowfat/socket/socket_bind4.c Mon Oct 15 11:25:06 2001 @@ -1,3 +1,4 @@ +#include #include #include #include "byte.h" diff -u -r libowfat-orig/socket/socket_bind4_reuse.c libowfat/socket/socket_bind4_reuse.c --- libowfat-orig/socket/socket_bind4_reuse.c Mon Feb 5 18:52:33 2001 +++ libowfat/socket/socket_bind4_reuse.c Mon Oct 15 11:26:00 2001 @@ -1,3 +1,4 @@ +#include #include #include "socket.h" diff -u -r libowfat-orig/socket/socket_bind6.c libowfat/socket/socket_bind6.c --- libowfat-orig/socket/socket_bind6.c Mon Feb 5 18:44:49 2001 +++ libowfat/socket/socket_bind6.c Mon Oct 15 11:28:50 2001 @@ -26,7 +26,12 @@ return bind(s,(struct sockaddr *) &sa,sizeof sa); #else - errno=EPROTO; + #ifdef EPROTO + errno=EPROTO; + #else + /* MacOS X */ + errno = EPROTONOSUPPORT; + #endif return -1; #endif } diff -u -r libowfat-orig/socket/socket_bind6_reuse.c libowfat/socket/socket_bind6_reuse.c --- libowfat-orig/socket/socket_bind6_reuse.c Mon Feb 5 18:56:40 2001 +++ libowfat/socket/socket_bind6_reuse.c Mon Oct 15 11:29:21 2001 @@ -1,3 +1,4 @@ +#include #include #include "socket.h" diff -u -r libowfat-orig/socket/socket_connect6.c libowfat/socket/socket_connect6.c --- libowfat-orig/socket/socket_connect6.c Mon Feb 5 23:00:13 2001 +++ libowfat/socket/socket_connect6.c Mon Oct 15 11:29:51 2001 @@ -7,7 +7,7 @@ #include "socket.h" #include "ip6.h" #include "haveip6.h" -#include "error.h" +/* #include "error.h" not needed ? */ #include "uint32.h" #include "ip4.h" diff -u -r libowfat-orig/socket/socket_connected.c libowfat/socket/socket_connected.c --- libowfat-orig/socket/socket_connected.c Mon Feb 5 18:43:10 2001 +++ libowfat/socket/socket_connected.c Mon Oct 15 11:32:56 2001 @@ -1,10 +1,11 @@ +#include #include #include #include "socket.h" int socket_connected(int s) { struct sockaddr si; - socklen_t sl=sizeof si; + int sl=sizeof si; if (getpeername(s,&si,&sl)) return 0; return 1; diff -u -r libowfat-orig/socket/socket_listen.c libowfat/socket/socket_listen.c --- libowfat-orig/socket/socket_listen.c Mon Feb 5 19:08:16 2001 +++ libowfat/socket/socket_listen.c Mon Oct 15 11:35:08 2001 @@ -1,3 +1,4 @@ +#include #include int socket_listen(int s,unsigned int backlog) { diff -u -r libowfat-orig/socket/socket_local6.c libowfat/socket/socket_local6.c --- libowfat-orig/socket/socket_local6.c Mon Feb 5 19:58:08 2001 +++ libowfat/socket/socket_local6.c Mon Oct 15 11:35:30 2001 @@ -6,7 +6,7 @@ #include "socket.h" #include "ip6.h" #include "haveip6.h" -#include "error.h" +/* #include "error.h" unused ? */ #include "uint32.h" int socket_local6(int s,char ip[16],uint16 *port,uint32 *scope_id) diff -u -r libowfat-orig/socket/socket_recv6.c libowfat/socket/socket_recv6.c --- libowfat-orig/socket/socket_recv6.c Mon Feb 5 19:45:30 2001 +++ libowfat/socket/socket_recv6.c Mon Oct 15 11:36:12 2001 @@ -5,7 +5,7 @@ #include "socket.h" #include "ip6.h" #include "haveip6.h" -#include "error.h" +/* #include "error.h" */ int socket_recv6(int s,char *buf,unsigned int len,char ip[16],uint16 *port,uint32 *scope_id) { diff -u -r libowfat-orig/socket/socket_remote6.c libowfat/socket/socket_remote6.c --- libowfat-orig/socket/socket_remote6.c Mon Feb 5 19:58:16 2001 +++ libowfat/socket/socket_remote6.c Mon Oct 15 11:36:41 2001 @@ -6,7 +6,7 @@ #include "socket.h" #include "ip6.h" #include "haveip6.h" -#include "error.h" +/* #include "error.h" unneeded ? */ #include "uint32.h" int socket_remote6(int s,char ip[16],uint16 *port,uint32 *scope_id) diff -u -r libowfat-orig/socket/socket_send6.c libowfat/socket/socket_send6.c --- libowfat-orig/socket/socket_send6.c Mon Feb 5 23:00:23 2001 +++ libowfat/socket/socket_send6.c Mon Oct 15 11:38:41 2001 @@ -26,7 +26,11 @@ if (byte_equal(ip,16,V6loopback)) return socket_send4(s,buf,len,ip4loopback,port); #ifdef LIBC_HAS_IP6 - errno=EPROTO; + #ifdef EPROTO + errno=EPROTO; + #else + errno=EPROTONOSUPPORT; + #endif return -1; } si.sin6_family = AF_INET6; @@ -34,7 +38,11 @@ byte_copy((char *) &si.sin6_addr,16,ip); return sendto(s,buf,len,0,(struct sockaddr *) &si,sizeof si); #else - errno=EPROTO; + #ifdef EPROTO + errno=EPROTO; + #else + errno=EPROTONOSUPPORT; + #endif return -1; #endif } diff -u -r libowfat-orig/socket/socket_tryreservein.c libowfat/socket/socket_tryreservein.c --- libowfat-orig/socket/socket_tryreservein.c Mon Feb 5 19:28:34 2001 +++ libowfat/socket/socket_tryreservein.c Mon Oct 15 11:39:16 2001 @@ -1,3 +1,4 @@ +#include #include #include "socket.h" diff -u -r libowfat-orig/uint/uint16_pack.c libowfat/uint/uint16_pack.c --- libowfat-orig/uint/uint16_pack.c Fri Feb 2 18:54:47 2001 +++ libowfat/uint/uint16_pack.c Mon Oct 15 11:43:49 2001 @@ -1,8 +1,8 @@ #define NO_UINT16_MACROS #include "uint16.h" -#include +/* #include unneeded ? */ -void uint16_pack(char *out,uint16 in) { +void uint16_pack(char *out, uint16 in) { out[0]=in&255; out[1]=in>>8; } diff -u -r libowfat-orig/uint/uint16_pack_big.c libowfat/uint/uint16_pack_big.c --- libowfat-orig/uint/uint16_pack_big.c Fri Feb 2 18:54:47 2001 +++ libowfat/uint/uint16_pack_big.c Mon Oct 15 11:42:41 2001 @@ -1,6 +1,6 @@ #define NO_UINT16_MACROS #include "uint16.h" -#include +/* #include unneded ? */ void uint16_pack_big(char *out,uint16 in) { out[0]=in>>8; diff -u -r libowfat-orig/uint/uint32_pack.c libowfat/uint/uint32_pack.c --- libowfat-orig/uint/uint32_pack.c Fri Feb 2 18:54:47 2001 +++ libowfat/uint/uint32_pack.c Mon Oct 15 11:43:22 2001 @@ -1,6 +1,6 @@ #define NO_UINT32_MACROS #include "uint32.h" -#include +/* #include */ void uint32_pack(char *out,uint32 in) { *out=in&0xff; in>>=8; diff -u -r libowfat-orig/uint/uint32_pack_big.c libowfat/uint/uint32_pack_big.c --- libowfat-orig/uint/uint32_pack_big.c Fri Feb 2 18:54:47 2001 +++ libowfat/uint/uint32_pack_big.c Mon Oct 15 11:43:11 2001 @@ -1,6 +1,6 @@ #define NO_UINT32_MACROS #include "uint32.h" -#include +/* #include unneded ? */ void uint32_pack_big(char *out,uint32 in) { out[3]=in&0xff; in>>=8;