From 05480c229a71a199ebd4080f2f069981c66a10e5 Mon Sep 17 00:00:00 2001 From: Gianluca Guida Date: Mon, 14 Feb 2011 12:49:18 +0000 Subject: [PATCH] Move network includes and lib.h into common/include subdir. This patch moves further includes (the network part and lib.h) in common/. It is the last part to get the netbsd libc to compile under minix. Further moves will be needed as we get the netbsd libc to compile minix itself. Also, this patch add #ifndef's to termios.h, as it create problems with netbsd's namespace.h. --- common/include/Makefile.inc | 15 +++++++++++++-- {include => common/include}/lib.h | 0 {include => common/include}/minix/u64.h | 0 {include => common/include}/net/gen/arp_io.h | 0 {include => common/include}/net/gen/dhcp.h | 0 {include => common/include}/net/gen/eth_hdr.h | 0 {include => common/include}/net/gen/eth_io.h | 0 {include => common/include}/net/gen/ether.h | 0 {include => common/include}/net/gen/icmp.h | 0 {include => common/include}/net/gen/icmp_hdr.h | 0 {include => common/include}/net/gen/if_ether.h | 0 {include => common/include}/net/gen/in.h | 0 {include => common/include}/net/gen/inet.h | 0 {include => common/include}/net/gen/ip_hdr.h | 0 {include => common/include}/net/gen/ip_io.h | 0 {include => common/include}/net/gen/nameser.h | 0 {include => common/include}/net/gen/netdb.h | 0 {include => common/include}/net/gen/oneCsum.h | 0 {include => common/include}/net/gen/psip_hdr.h | 0 {include => common/include}/net/gen/psip_io.h | 0 {include => common/include}/net/gen/resolv.h | 0 {include => common/include}/net/gen/rip.h | 0 {include => common/include}/net/gen/route.h | 0 {include => common/include}/net/gen/socket.h | 0 {include => common/include}/net/gen/tcp.h | 0 {include => common/include}/net/gen/tcp_hdr.h | 0 {include => common/include}/net/gen/tcp_io.h | 0 {include => common/include}/net/gen/udp.h | 0 {include => common/include}/net/gen/udp_hdr.h | 0 {include => common/include}/net/gen/udp_io.h | 0 {include => common/include}/net/gen/vjhc.h | 0 common/include/termios.h | 8 ++++++++ include/Makefile | 18 ++++-------------- 33 files changed, 25 insertions(+), 16 deletions(-) rename {include => common/include}/lib.h (100%) rename {include => common/include}/minix/u64.h (100%) rename {include => common/include}/net/gen/arp_io.h (100%) rename {include => common/include}/net/gen/dhcp.h (100%) rename {include => common/include}/net/gen/eth_hdr.h (100%) rename {include => common/include}/net/gen/eth_io.h (100%) rename {include => common/include}/net/gen/ether.h (100%) rename {include => common/include}/net/gen/icmp.h (100%) rename {include => common/include}/net/gen/icmp_hdr.h (100%) rename {include => common/include}/net/gen/if_ether.h (100%) rename {include => common/include}/net/gen/in.h (100%) rename {include => common/include}/net/gen/inet.h (100%) rename {include => common/include}/net/gen/ip_hdr.h (100%) rename {include => common/include}/net/gen/ip_io.h (100%) rename {include => common/include}/net/gen/nameser.h (100%) rename {include => common/include}/net/gen/netdb.h (100%) rename {include => common/include}/net/gen/oneCsum.h (100%) rename {include => common/include}/net/gen/psip_hdr.h (100%) rename {include => common/include}/net/gen/psip_io.h (100%) rename {include => common/include}/net/gen/resolv.h (100%) rename {include => common/include}/net/gen/rip.h (100%) rename {include => common/include}/net/gen/route.h (100%) rename {include => common/include}/net/gen/socket.h (100%) rename {include => common/include}/net/gen/tcp.h (100%) rename {include => common/include}/net/gen/tcp_hdr.h (100%) rename {include => common/include}/net/gen/tcp_io.h (100%) rename {include => common/include}/net/gen/udp.h (100%) rename {include => common/include}/net/gen/udp_hdr.h (100%) rename {include => common/include}/net/gen/udp_io.h (100%) rename {include => common/include}/net/gen/vjhc.h (100%) diff --git a/common/include/Makefile.inc b/common/include/Makefile.inc index d61058512..62a4454a0 100644 --- a/common/include/Makefile.inc +++ b/common/include/Makefile.inc @@ -2,6 +2,8 @@ .PATH: ${MINIXSRCDIR}/common/include +INCS+= lib.h + INCS+= minix/ansi.h minix/bitmap.h minix/callnr.h minix/com.h \ minix/compiler.h minix/config.h minix/const.h minix/debug.h \ minix/devio.h minix/ds.h minix/endpoint.h minix/gcov.h \ @@ -9,6 +11,15 @@ INCS+= minix/ansi.h minix/bitmap.h minix/callnr.h minix/com.h \ minix/limits.h minix/minlib.h minix/portio.h minix/priv.h \ minix/profile.h minix/rs.h minix/safecopies.h minix/sef.h \ minix/spin.h minix/sys_config.h minix/sysinfo.h minix/syslib.h \ - minix/sysutil.h minix/timers.h minix/type.h minix/vm.h - + minix/sysutil.h minix/timers.h minix/type.h minix/u64.h minix/vm.h +INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \ + net/gen/eth_hdr.h net/gen/eth_io.h net/gen/icmp.h \ + net/gen/icmp_hdr.h net/gen/if_ether.h net/gen/inet.h \ + net/gen/in.h net/gen/ip_hdr.h net/gen/ip_io.h \ + net/gen/nameser.h net/gen/netdb.h net/gen/oneCsum.h \ + net/gen/psip_hdr.h net/gen/psip_io.h net/gen/resolv.h \ + net/gen/rip.h net/gen/route.h net/gen/socket.h \ + net/gen/tcp.h net/gen/tcp_hdr.h net/gen/tcp_io.h \ + net/gen/udp.h net/gen/udp_hdr.h net/gen/udp_io.h \ + net/gen/vjhc.h diff --git a/include/lib.h b/common/include/lib.h similarity index 100% rename from include/lib.h rename to common/include/lib.h diff --git a/include/minix/u64.h b/common/include/minix/u64.h similarity index 100% rename from include/minix/u64.h rename to common/include/minix/u64.h diff --git a/include/net/gen/arp_io.h b/common/include/net/gen/arp_io.h similarity index 100% rename from include/net/gen/arp_io.h rename to common/include/net/gen/arp_io.h diff --git a/include/net/gen/dhcp.h b/common/include/net/gen/dhcp.h similarity index 100% rename from include/net/gen/dhcp.h rename to common/include/net/gen/dhcp.h diff --git a/include/net/gen/eth_hdr.h b/common/include/net/gen/eth_hdr.h similarity index 100% rename from include/net/gen/eth_hdr.h rename to common/include/net/gen/eth_hdr.h diff --git a/include/net/gen/eth_io.h b/common/include/net/gen/eth_io.h similarity index 100% rename from include/net/gen/eth_io.h rename to common/include/net/gen/eth_io.h diff --git a/include/net/gen/ether.h b/common/include/net/gen/ether.h similarity index 100% rename from include/net/gen/ether.h rename to common/include/net/gen/ether.h diff --git a/include/net/gen/icmp.h b/common/include/net/gen/icmp.h similarity index 100% rename from include/net/gen/icmp.h rename to common/include/net/gen/icmp.h diff --git a/include/net/gen/icmp_hdr.h b/common/include/net/gen/icmp_hdr.h similarity index 100% rename from include/net/gen/icmp_hdr.h rename to common/include/net/gen/icmp_hdr.h diff --git a/include/net/gen/if_ether.h b/common/include/net/gen/if_ether.h similarity index 100% rename from include/net/gen/if_ether.h rename to common/include/net/gen/if_ether.h diff --git a/include/net/gen/in.h b/common/include/net/gen/in.h similarity index 100% rename from include/net/gen/in.h rename to common/include/net/gen/in.h diff --git a/include/net/gen/inet.h b/common/include/net/gen/inet.h similarity index 100% rename from include/net/gen/inet.h rename to common/include/net/gen/inet.h diff --git a/include/net/gen/ip_hdr.h b/common/include/net/gen/ip_hdr.h similarity index 100% rename from include/net/gen/ip_hdr.h rename to common/include/net/gen/ip_hdr.h diff --git a/include/net/gen/ip_io.h b/common/include/net/gen/ip_io.h similarity index 100% rename from include/net/gen/ip_io.h rename to common/include/net/gen/ip_io.h diff --git a/include/net/gen/nameser.h b/common/include/net/gen/nameser.h similarity index 100% rename from include/net/gen/nameser.h rename to common/include/net/gen/nameser.h diff --git a/include/net/gen/netdb.h b/common/include/net/gen/netdb.h similarity index 100% rename from include/net/gen/netdb.h rename to common/include/net/gen/netdb.h diff --git a/include/net/gen/oneCsum.h b/common/include/net/gen/oneCsum.h similarity index 100% rename from include/net/gen/oneCsum.h rename to common/include/net/gen/oneCsum.h diff --git a/include/net/gen/psip_hdr.h b/common/include/net/gen/psip_hdr.h similarity index 100% rename from include/net/gen/psip_hdr.h rename to common/include/net/gen/psip_hdr.h diff --git a/include/net/gen/psip_io.h b/common/include/net/gen/psip_io.h similarity index 100% rename from include/net/gen/psip_io.h rename to common/include/net/gen/psip_io.h diff --git a/include/net/gen/resolv.h b/common/include/net/gen/resolv.h similarity index 100% rename from include/net/gen/resolv.h rename to common/include/net/gen/resolv.h diff --git a/include/net/gen/rip.h b/common/include/net/gen/rip.h similarity index 100% rename from include/net/gen/rip.h rename to common/include/net/gen/rip.h diff --git a/include/net/gen/route.h b/common/include/net/gen/route.h similarity index 100% rename from include/net/gen/route.h rename to common/include/net/gen/route.h diff --git a/include/net/gen/socket.h b/common/include/net/gen/socket.h similarity index 100% rename from include/net/gen/socket.h rename to common/include/net/gen/socket.h diff --git a/include/net/gen/tcp.h b/common/include/net/gen/tcp.h similarity index 100% rename from include/net/gen/tcp.h rename to common/include/net/gen/tcp.h diff --git a/include/net/gen/tcp_hdr.h b/common/include/net/gen/tcp_hdr.h similarity index 100% rename from include/net/gen/tcp_hdr.h rename to common/include/net/gen/tcp_hdr.h diff --git a/include/net/gen/tcp_io.h b/common/include/net/gen/tcp_io.h similarity index 100% rename from include/net/gen/tcp_io.h rename to common/include/net/gen/tcp_io.h diff --git a/include/net/gen/udp.h b/common/include/net/gen/udp.h similarity index 100% rename from include/net/gen/udp.h rename to common/include/net/gen/udp.h diff --git a/include/net/gen/udp_hdr.h b/common/include/net/gen/udp_hdr.h similarity index 100% rename from include/net/gen/udp_hdr.h rename to common/include/net/gen/udp_hdr.h diff --git a/include/net/gen/udp_io.h b/common/include/net/gen/udp_io.h similarity index 100% rename from include/net/gen/udp_io.h rename to common/include/net/gen/udp_io.h diff --git a/include/net/gen/vjhc.h b/common/include/net/gen/vjhc.h similarity index 100% rename from include/net/gen/vjhc.h rename to common/include/net/gen/vjhc.h diff --git a/common/include/termios.h b/common/include/termios.h index d194fc39f..a0b0f6517 100644 --- a/common/include/termios.h +++ b/common/include/termios.h @@ -133,10 +133,18 @@ _PROTOTYPE( int tcgetattr, (int _filedes, struct termios *_termios_p) ); _PROTOTYPE( int tcsetattr, \ (int _filedes, int _opt_actions, const struct termios *_termios_p) ); +#ifndef cfgetispeed #define cfgetispeed(termios_p) ((termios_p)->c_ispeed) +#endif +#ifndef cfgetospeed #define cfgetospeed(termios_p) ((termios_p)->c_ospeed) +#endif +#ifndef cfsetispeed #define cfsetispeed(termios_p, speed) ((termios_p)->c_ispeed = (speed), 0) +#endif +#ifndef cfsetospeed #define cfsetospeed(termios_p, speed) ((termios_p)->c_ospeed = (speed), 0) +#endif #ifdef _MINIX /* Here are the local extensions to the POSIX standard for Minix. Posix diff --git a/include/Makefile b/include/Makefile index 1a808df3d..fef66f611 100644 --- a/include/Makefile +++ b/include/Makefile @@ -3,7 +3,7 @@ INCS= alloca.h a.out.h ar.h assert.h configfile.h ctype.h \ curses.h dirent.h env.h err.h errno.h fcntl.h fenv.h \ float.h fnmatch.h fts.h getopt.h glob.h grp.h ifaddrs.h \ - inttypes.h libgen.h lib.h libutil.h limits.h locale.h \ + inttypes.h libgen.h libutil.h limits.h locale.h \ mathconst.h math.h midiparser.h netdb.h pwd.h regex.h \ regexp.h setjmp.h sgtty.h signal.h stdarg.h stddef.h \ stdint.h stdbool.h stdio.h stdlib.h string.h strings.h sysexits.h \ @@ -24,28 +24,18 @@ INCS+= minix/a.out.h minix/cdrom.h minix/cpufeature.h \ minix/queryparam.h \ minix/sched.h minix/sound.h \ minix/tty.h minix/types.h \ - minix/u64.h minix/vfsif.h minix/vtreefs.h \ + minix/vfsif.h minix/vtreefs.h \ minix/compiler-ack.h minix/sha2.h minix/sha1.h minix/md5.h \ minix/audio_fw.h minix/hash.h minix/input.h INCS+= net/hton.h net/if.h net/ioctl.h net/netlib.h -INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \ - net/gen/eth_hdr.h net/gen/eth_io.h net/gen/icmp.h \ - net/gen/icmp_hdr.h net/gen/if_ether.h net/gen/inet.h \ - net/gen/in.h net/gen/ip_hdr.h net/gen/ip_io.h \ - net/gen/nameser.h net/gen/netdb.h net/gen/oneCsum.h \ - net/gen/psip_hdr.h net/gen/psip_io.h net/gen/resolv.h \ - net/gen/rip.h net/gen/route.h net/gen/socket.h \ - net/gen/tcp.h net/gen/tcp_hdr.h net/gen/tcp_io.h \ - net/gen/udp.h net/gen/udp_hdr.h net/gen/udp_io.h \ - net/gen/vjhc.h INCS+= netinet/if_ether.h netinet/in.h netinet/tcp.h .include INCSDIR= /usr/include -.include "../common/include/Makefile.inc" -.include "../common/include/Makefile.termios.inc" +.include "${MINIXSRCDIR}/common/include/Makefile.inc" +.include "${MINIXSRCDIR}/common/include/Makefile.termios.inc" SUBDIR= sys arch -- 2.44.0