diff -Nurd linux86.old/Changes linux86/Changes --- linux86.old/Changes Thu Jul 31 19:35:29 2003 +++ linux86/Changes Sat Sep 20 18:43:23 2003 @@ -1,5 +1,13 @@ For version 0.16.*. +> More changes so it compiles better on 'other' machines. + Removed some GNU-Make'isms in the top header file. + +> Some changes for cygwin, it isn't quite as nasty as compiling for minix + but it doesn't miss by much! + +> Compiling for the 'tcc' complier, nice and easy. + > Hitting bcc.c again, bcc-cpp now the default. > Some bugfixes for DEC Alpha -- 64 bit longs! diff -Nurd linux86.old/Contributors linux86/Contributors --- linux86.old/Contributors Tue Jan 15 08:14:44 2002 +++ linux86/Contributors Sun Aug 31 06:29:07 2003 @@ -11,10 +11,7 @@ patch file available via http://cix.co.uk/~mayday/ We're all available through the Linux-8086 mailing list at: - linux-8086@vger.rutgers.edu - -send a blank message to for help on joining -the list. + linux-8086@vger.kernel.org Rob. diff -Nurd linux86.old/Makefile linux86/Makefile --- linux86.old/Makefile Wed Jan 29 20:13:20 2003 +++ linux86/Makefile Thu Jul 31 21:33:54 2003 @@ -2,7 +2,7 @@ # This file is part of the Linux-8086 Development environment and is # distributed under the GNU General Public License. -VERSION=0.16.12 +VERSION=0.16.13 TARGETS= \ clean bcc unproto copt as86 ld86 elksemu \ diff -Nurd linux86.old/Mk_dist linux86/Mk_dist --- linux86.old/Mk_dist Sun Aug 11 07:46:51 2002 +++ linux86/Mk_dist Sun Aug 31 14:48:32 2003 @@ -175,14 +175,14 @@ ln -s ${TMPSRC}/as as86-$VERSION cp -p ${TMPSRC}/man/as86.1 as86-$VERSION/as86.1 cp -p ${TMPSRC}/COPYING as86-$VERSION/COPYING -echo VERSION=$VERSION > as86-$VERSION/Version +echo '#define VERSION "'"$VERSION"'"' > as86-$VERSION/version.h tar cf ${ARCDIR}/as86-$VERSION.tar `find as86-$VERSION/* -prune -type f` gzip -f9 ${ARCDIR}/as86-*.tar echo Creating bin86 source archive. make -s -C ${TMPSRC}/bin86 VERSION=${VERSION} grab ln -s ${TMPSRC}/bin86 bin86-$VERSION -echo VERSION=$VERSION > bin86-$VERSION/ld/Version +echo '#define VERSION "'"$VERSION"'"' > bin86-$VERSION/ld/version.h tar chf ${ARCDIR}/bin86-$VERSION.tar bin86-$VERSION make -s -C ${TMPSRC}/bin86 ungrab gzip -f9 ${ARCDIR}/bin86-*.tar diff -Nurd linux86.old/ar/Makefile linux86/ar/Makefile --- linux86.old/ar/Makefile Tue Mar 26 07:34:17 2002 +++ linux86/ar/Makefile Sun Aug 31 13:54:08 2003 @@ -6,12 +6,12 @@ CFLAGS =-O LDFLAGS = DEFS = -OBJS= ar.o +OBJS= ar.o alloca.o all: ar86 ar86: $(OBJS) - $(CC) $(LDFLAGS) $^ -o $@ + $(CC) $(LDFLAGS) $(OBJS) -o $@ install: ar86 install -d $(LIBDIR) @@ -23,12 +23,12 @@ $(OBJS): ar.h rel_aout.h ar.h: - [ -f ar.h ] || \ + test -f ar.h || \ { rm -f ar.h ; ln -s ../libc/include/ar.h . ; } || \ ln ../libc/include/ar.h . rel_aout.h: - [ -f rel_aout.h ] || \ + test -f rel_aout.h || \ { rm -f rel_aout.h ; ln -s ../ld/rel_aout.h . ; } || \ ln ../ld/rel_aout.h . diff -Nurd linux86.old/ar/alloca.c linux86/ar/alloca.c --- linux86.old/ar/alloca.c Thu Jan 1 01:00:00 1970 +++ linux86/ar/alloca.c Mon Aug 18 08:13:58 2003 @@ -0,0 +1,61 @@ + +#ifdef __STDC__ +#include +#else +#include +#include +#endif + +#ifdef __TINYC__ +typedef union mem_cell +{ + union mem_cell *next; /* A pointer to the next mem */ + unsigned int size; /* An int >= sizeof pointer */ + char *depth; /* For the alloca hack */ +} +mem; + +#define m_size(p) ((p) [0].size) /* For malloc */ +#define m_next(p) ((p) [1].next) /* For malloc and alloca */ +#define m_deep(p) ((p) [0].depth) /* For alloca */ + +static mem *alloca_stack = 0; + +void * +alloca(size) +size_t size; +{ + auto char probe; /* Probes stack depth: */ + register mem *hp; + + /* + * Reclaim garbage, defined as all alloca'd storage that was allocated + * from deeper in the stack than currently. + */ + + for (hp = alloca_stack; hp != 0;) + if (m_deep(hp) < &probe) + { + register mem *np = m_next(hp); + free((void *) hp); /* Collect garbage. */ + hp = np; /* -> next header. */ + } + else + break; /* Rest are not deeper. */ + + alloca_stack = hp; /* -> last valid storage. */ + if (size == 0) + return 0; /* No allocation required. */ + + hp = (mem *) malloc(sizeof(mem)*2 + size); + if (hp == 0) + return hp; + + m_next(hp) = alloca_stack; + m_deep(hp) = &probe; + alloca_stack = hp; + + /* User storage begins just after header. */ + return (void *) (hp + 2); +} +#endif diff -Nurd linux86.old/ar/ar.c linux86/ar/ar.c --- linux86.old/ar/ar.c Tue Mar 26 07:24:53 2002 +++ linux86/ar/ar.c Sun Aug 31 09:09:29 2003 @@ -29,6 +29,7 @@ #include #include #include +#include #include "ar.h" #include "rel_aout.h" @@ -43,6 +44,7 @@ #define HAVE_RENAME #undef HAVE_FSYNC #endif +#define HAVE_TRAILING_SLASH_IN_NAME extern int errno; @@ -53,8 +55,6 @@ #else # if defined(sparc) || defined(HAVE_ALLOCA_H) # include -# else -char *alloca (); # endif #endif diff -Nurd linux86.old/as/Makefile linux86/as/Makefile --- linux86.old/as/Makefile Wed Mar 20 21:58:30 2002 +++ linux86/as/Makefile Sun Aug 31 15:15:29 2003 @@ -1,8 +1,4 @@ -ifeq ($(VERSION),) -include Version -endif - CFLAGS=-O LDFLAGS=-s LIBDIR=/usr/bin @@ -20,7 +16,7 @@ as86_encap: as86_encap.sh sed -e "s:%%LIBDIR%%:$(LIBDIR):" -e "s:%%BINDIR%%:$(BINDIR):" \ - < $^ > tmp + < as86_encap.sh > tmp @mv -f tmp $@ chmod +x $@ @@ -35,7 +31,7 @@ rm -f *.o as86 as86_encap .c.o: - $(CC) -DVERSION='"$(VERSION)"' $(CFLAGS) -c $< + $(CC) $(CFLAGS) -c $< as.o: const.h type.h byteord.h macro.h file.h flag.h globvar.h assemble.o: const.h type.h address.h globvar.h opcode.h scan.h @@ -53,4 +49,3 @@ readsrc.o: const.h type.h flag.h file.h globvar.h macro.h scan.h source.h scan.o: const.h type.h globvar.h scan.h table.o: const.h type.h globvar.h opcode.h scan.h - diff -Nurd linux86.old/as/as.c linux86/as/as.c --- linux86.old/as/as.c Wed Mar 20 22:13:50 2002 +++ linux86/as/as.c Sun Aug 31 14:24:58 2003 @@ -15,6 +15,7 @@ #include "file.h" #include "flag.h" #include "globvar.h" +#include "version.h" PUBLIC char hexdigit[] = "0123456789ABCDEF"; /* XXX - ld uses lower case */ diff -Nurd linux86.old/bcc/Makefile linux86/bcc/Makefile --- linux86.old/bcc/Makefile Wed Mar 20 22:24:45 2002 +++ linux86/bcc/Makefile Sun Aug 31 14:28:01 2003 @@ -12,7 +12,7 @@ LIBDIR =$(LIBPRE)/lib/bcc BCCDEFS =-DLOCALPREFIX=$(LIBPRE) -DBINDIR=$(BINDIR) -DDEFARCH=0 -BCFLAGS=$(ANSI) $(CFLAGS) $(LDFLAGS) -DVERSION='"$(VERSION)"' +BCFLAGS=$(ANSI) $(CFLAGS) $(LDFLAGS) OBJS = bcc-cc1.o codefrag.o debug.o declare.o express.o exptree.o floatop.o \ function.o gencode.o genloads.o glogcode.o hardop.o input.o label.o \ @@ -28,16 +28,16 @@ install -m 755 bcc-cc1 $(LIBDIR)/bcc-cc1 bcc: bcc.c - $(CC) $(BCFLAGS) $(BCCDEFS) $^ -o $@ + $(CC) $(BCFLAGS) $(BCCDEFS) bcc.c -o $@ ncc: bcc.c - $(CC) $(BCFLAGS) -DL_TREE -DDEFARCH=0 $^ -o $@ + $(CC) $(BCFLAGS) -DL_TREE -DDEFARCH=0 bcc.c -o $@ bcc09: bcc.c - $(CC) $(BCFLAGS) -DMC6809 $(BCCDEFS) $^ -o $@ + $(CC) $(BCFLAGS) -DMC6809 $(BCCDEFS) bcc.c -o $@ ccc: bcc.c - $(CC) $(BCFLAGS) -DCCC $(BCCDEFS) $^ -o $@ + $(CC) $(BCFLAGS) -DCCC $(BCCDEFS) bcc.c -o $@ bcc-cc1: $(OBJS) $(CC) $(BCCARCH) $(LDFLAGS) $(OBJS) -o bcc-cc1 diff -Nurd linux86.old/bcc/bcc.c linux86/bcc/bcc.c --- linux86.old/bcc/bcc.c Thu Dec 5 08:34:34 2002 +++ linux86/bcc/bcc.c Sun Aug 31 14:30:18 2003 @@ -32,6 +32,7 @@ #include #include #endif +#include "version.h" #ifdef MSDOS #define LOCALPREFIX /linux86 @@ -307,8 +308,8 @@ !do_unproto && do_compile); - if (combined_cpp && !do_optim && !do_as ) last_stage =1; - if (!combined_cpp && !do_unproto && !do_compile ) last_stage =1; + if (combined_cpp && !do_optim && !do_as ) last_stage =1; + if (!combined_cpp && !do_compile ) last_stage =1; newfilename(file, last_stage, (combined_cpp?'s':'i'), (opt_arch<5)); @@ -455,10 +456,10 @@ default: command.cmd = LD; break; } command_reset(); - if (executable_name == 0) executable_name = "a.out"; - - command_opt("-o"); - command_opt(executable_name); + if (executable_name) { + command_opt("-o"); + command_opt(executable_name); + } if (opt_arch < 2) command_opt("-y"); @@ -742,6 +743,20 @@ for(ar=1; ar -#include - -#if __STDC__ == (1UL) -#define strong_alias(Y,X) asm("export _" #X, "_" #X " = _" #Y ) -#else -#define strong_alias(Y,X) asm("export _" "X", "_" "X" " = _" "Y" ) -#endif - -#if 1 -# if __STDC__ -# define comb(x,y) x ## y -# warning Using Ansi combine -# elif __BCC__ -# define comb(x,y) x/**/y -# warning Using bcc combine -# else -# define comb(x,y) x/**/y -# warning Using K&R combine -# endif -#endif - -#define o define -#o signed unsigned -#o unsigned signed - -#ifdef signed -typedef signed char t_sc; -typedef comb(un,signed) char t_uc; - -char c; -t_sc sc; -t_uc uc; -#endif - -#pragma full optimise -strong_alias(main,zulu); -main() -{ - int i1, i2, i3; - - printf("sizeof(long double) = %d\n", sizeof(long double)); -#ifdef __GNUC__ - printf("sizeof(long float) = ERROR!\n"); - printf("sizeof(long long) = %d\n", sizeof(long long)); -#else - printf("sizeof(long float) = %d\n", sizeof(long float)); - printf("sizeof(long long) = ERROR!\n"); -#endif - printf("sizeof(double) = %d\n", sizeof(double)); - printf("sizeof(float) = %d\n", sizeof(float)); - - c = -6; - uc = -6; - sc = -6; - - printf("%ld, ", (long)c); - printf("%ld, ", (long)uc); - printf("%ld\n", (long)sc); - - printf("%d, ", c); - printf("%d, ", uc); - printf("%d\n", sc); - - i1 = c; i2 = uc; i3 = sc; - - printf("%d, ", i1); - printf("%d, ", i2); - printf("%d\n", i3); - - i1 = (char) 200 + (char) 50; - i2 = (t_uc) 200 + (t_uc) 50; - i3 = (t_sc) 200 + (t_sc) 50; - - printf("%d, ", i1); - printf("%d, ", i2); - printf("%d\n", i3); - - c = 200; uc = 200; sc = 200; - - i1 = c + (long) 50; - i2 = uc + (long) 50; - i3 = sc + (long) 50; - - printf("%d, ", i1); - printf("%d, ", i2); - printf("%d\n", i3); -} diff -Nurd linux86.old/cpp/cygwin.c linux86/cpp/cygwin.c --- linux86.old/cpp/cygwin.c Thu Jan 1 01:00:00 1970 +++ linux86/cpp/cygwin.c Sun Aug 31 08:10:05 2003 @@ -0,0 +1,99 @@ +/* Copyright (C) 1995,1996 Robert de Bath + * This file is part of the Linux-8086 C library and is distributed + * under the GNU Library General Public License. + */ + +/* + * CTYPE Character classification and conversion + */ + +/* + * I've copied this here from the bcc libs because cygwin's version has + * the _very_ silly feature of using _P as a private library constant. + * + * Single underscore variables are generally used for private variables + * in user libraries; the few stdio ones being 'leftovers' from version7 + * where user and system libraries were one and the same. + * + */ +#ifndef __CTYPE_H +#define __CTYPE_H + +static unsigned char __ctype[]; + +#define __CT_d 0x01 /* numeric digit */ +#define __CT_u 0x02 /* upper case */ +#define __CT_l 0x04 /* lower case */ +#define __CT_c 0x08 /* control character */ +#define __CT_s 0x10 /* whitespace */ +#define __CT_p 0x20 /* punctuation */ +#define __CT_x 0x40 /* hexadecimal */ + +/* Define these as simple old style ascii versions */ +#define toupper(c) (((c)>='a'&&(c)<='z') ? (c)^0x20 : (c)) +#define tolower(c) (((c)>='A'&&(c)<='Z') ? (c)^0x20 : (c)) +#define _toupper(c) ((c)^0x20) +#define _tolower(c) ((c)^0x20) +#define toascii(c) ((c)&0x7F) + +#define __CT(c) (__ctype[1+(unsigned char)c]) + +/* Note the '!!' is a cast to 'bool' and even BCC deletes it in an if() */ +#define isalnum(c) (!!(__CT(c)&(__CT_u|__CT_l|__CT_d))) +#define isalpha(c) (!!(__CT(c)&(__CT_u|__CT_l))) +#define isascii(c) (!((c)&~0x7F)) +#define iscntrl(c) (!!(__CT(c)&__CT_c)) +#define isdigit(c) (!!(__CT(c)&__CT_d)) +#define isgraph(c) (!(__CT(c)&(__CT_c|__CT_s))) +#define islower(c) (!!(__CT(c)&__CT_l)) +#define isprint(c) (!(__CT(c)&__CT_c)) +#define ispunct(c) (!!(__CT(c)&__CT_p)) +#define isspace(c) (!!(__CT(c)&__CT_s)) +#define isupper(c) (!!(__CT(c)&__CT_u)) +#define isxdigit(c) (!!(__CT(c)&__CT_x)) + +static unsigned char __ctype[257] = +{ + 0, /* -1 */ + __CT_c, __CT_c, __CT_c, __CT_c, /* 0x00..0x03 */ + __CT_c, __CT_c, __CT_c, __CT_c, /* 0x04..0x07 */ + __CT_c, __CT_c|__CT_s, __CT_c|__CT_s, __CT_c|__CT_s, /* 0x08..0x0B */ + __CT_c|__CT_s, __CT_c|__CT_s, __CT_c, __CT_c, /* 0x0C..0x0F */ + + __CT_c, __CT_c, __CT_c, __CT_c, /* 0x10..0x13 */ + __CT_c, __CT_c, __CT_c, __CT_c, /* 0x14..0x17 */ + __CT_c, __CT_c, __CT_c, __CT_c, /* 0x18..0x1B */ + __CT_c, __CT_c, __CT_c, __CT_c, /* 0x1C..0x1F */ + + __CT_s, __CT_p, __CT_p, __CT_p, /* 0x20..0x23 */ + __CT_p, __CT_p, __CT_p, __CT_p, /* 0x24..0x27 */ + __CT_p, __CT_p, __CT_p, __CT_p, /* 0x28..0x2B */ + __CT_p, __CT_p, __CT_p, __CT_p, /* 0x2C..0x2F */ + + __CT_d|__CT_x, __CT_d|__CT_x, __CT_d|__CT_x, __CT_d|__CT_x,/* 0x30..0x33 */ + __CT_d|__CT_x, __CT_d|__CT_x, __CT_d|__CT_x, __CT_d|__CT_x,/* 0x34..0x37 */ + __CT_d|__CT_x, __CT_d|__CT_x, __CT_p, __CT_p, /* 0x38..0x3B */ + __CT_p, __CT_p, __CT_p, __CT_p, /* 0x3C..0x3F */ + + __CT_p, __CT_u|__CT_x, __CT_u|__CT_x, __CT_u|__CT_x, /* 0x40..0x43 */ + __CT_u|__CT_x, __CT_u|__CT_x, __CT_u|__CT_x, __CT_u, /* 0x44..0x47 */ + __CT_u, __CT_u, __CT_u, __CT_u, /* 0x48..0x4B */ + __CT_u, __CT_u, __CT_u, __CT_u, /* 0x4C..0x4F */ + + __CT_u, __CT_u, __CT_u, __CT_u, /* 0x50..0x53 */ + __CT_u, __CT_u, __CT_u, __CT_u, /* 0x54..0x57 */ + __CT_u, __CT_u, __CT_u, __CT_p, /* 0x58..0x5B */ + __CT_p, __CT_p, __CT_p, __CT_p, /* 0x5C..0x5F */ + + __CT_p, __CT_l|__CT_x, __CT_l|__CT_x, __CT_l|__CT_x, /* 0x60..0x63 */ + __CT_l|__CT_x, __CT_l|__CT_x, __CT_l|__CT_x, __CT_l, /* 0x64..0x67 */ + __CT_l, __CT_l, __CT_l, __CT_l, /* 0x68..0x6B */ + __CT_l, __CT_l, __CT_l, __CT_l, /* 0x6C..0x6F */ + + __CT_l, __CT_l, __CT_l, __CT_l, /* 0x70..0x73 */ + __CT_l, __CT_l, __CT_l, __CT_l, /* 0x74..0x77 */ + __CT_l, __CT_l, __CT_l, __CT_p, /* 0x78..0x7B */ + __CT_p, __CT_p, __CT_p, __CT_c /* 0x7C..0x7F */ +}; + +#endif /* __CTYPE_H */ diff -Nurd linux86.old/cpp/main.c linux86/cpp/main.c --- linux86.old/cpp/main.c Thu Dec 5 08:05:19 2002 +++ linux86/cpp/main.c Sun Aug 31 08:13:22 2003 @@ -4,7 +4,11 @@ #include #include #endif +#ifndef __CYGWIN__ #include +#else +#include "cygwin.c" +#endif #include #include #include diff -Nurd linux86.old/cpp/q.c linux86/cpp/q.c --- linux86.old/cpp/q.c Fri Aug 2 20:33:48 2002 +++ linux86/cpp/q.c Thu Jan 1 01:00:00 1970 @@ -1,26 +0,0 @@ -#define m_size(p) ((p) [0].size) /* For malloc */ -#define m_next(p) ((p) [1].next) /* For malloc and alloca */ -#define m_deep(p) ((p) [0].depth) /* For alloca */ - m_size(p1) += m_size(m_next(p1)); - m_next(p1) = m_next(m_next(p1)); - noise("JÖIN \"2\" EOF?->˙", p1); -#asm - hello?? -??=warning oooer -/\ -* wtf! */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ -#define bb 11 -#define cc 22 -#define bbcc 4455 -#define comba(x,y) x/**/y -#define combb(x,y) x ## y -#define empty - - \0 \00 \000 \0000 \200 \x34f \xff -bb\ -cc - comba(un,signed); ++ -- >> << {} combb(un,signed); -#endasm diff -Nurd linux86.old/ifdef.c linux86/ifdef.c --- linux86.old/ifdef.c Wed Sep 4 22:10:57 2002 +++ linux86/ifdef.c Sun Aug 31 07:12:58 2003 @@ -495,4 +495,8 @@ #ifdef __minix save_name("__minix", 'D'); #endif +/* This isn't much nicer */ +#ifdef __CYGWIN__ + save_name("__CYGWIN__", 'D'); +#endif } diff -Nurd linux86.old/ld/Makefile linux86/ld/Makefile --- linux86.old/ld/Makefile Wed Mar 20 21:58:20 2002 +++ linux86/ld/Makefile Sun Aug 31 15:19:52 2003 @@ -1,8 +1,4 @@ -ifeq ($(VERSION),) -include Version -endif - LIBDIR =/usr/bin CFLAGS =-O LDFLAGS = @@ -13,7 +9,7 @@ # -DSTANDARD_GNU_A_OUT # a.out.h is like GNU normal. # -DNO_AOUT # a.out.h is like nothing known! # -DEFS =-DREL_OUTPUT -DBUGCOMPAT -DVERSION='"$(VERSION)"' +DEFS =-DREL_OUTPUT -DBUGCOMPAT # An alternative file for a non-standard a.out.h (eg i386 linux on an Alpha) # @@ -25,11 +21,11 @@ all: ld86 objchop catimage objdump86 ld86: $(OBJS) - $(CC) $(LDFLAGS) $^ -o $@ + $(CC) $(LDFLAGS) $(OBJS) -o $@ install: ld86 install -d $(LIBDIR) - install -m 755 $^ $(LIBDIR) + install -m 755 ld86 $(LIBDIR) clean realclean clobber: rm -f *.o ld86 ld86r objchop catimage objdump86 @@ -38,7 +34,7 @@ syshead.h type.h x86_aout.h ar.h: - [ -f ar.h ] || \ + test -f ar.h || \ { rm -f ar.h ; ln -s ../libc/include/ar.h . ; } || \ ln ../libc/include/ar.h . diff -Nurd linux86.old/ld/bindef.h linux86/ld/bindef.h --- linux86.old/ld/bindef.h Tue Mar 30 11:58:34 1999 +++ linux86/ld/bindef.h Sun Aug 31 13:06:09 2003 @@ -1,4 +1,5 @@ +#if defined(__i386__) || defined(__8086__) || defined(__i386) #ifndef MSDOS #ifndef NO_AOUT /* Ok, I'm just gonna make it simple ... override this if you like. */ @@ -76,3 +77,4 @@ #endif /* NO_AOUT */ #endif /* MSDOS */ +#endif /* CPU type */ diff -Nurd linux86.old/ld/io.c linux86/ld/io.c --- linux86.old/ld/io.c Wed Mar 20 22:16:59 2002 +++ linux86/ld/io.c Sun Aug 31 14:32:57 2003 @@ -6,6 +6,7 @@ #include "const.h" #include "type.h" #include "globvar.h" +#include "version.h" #define DRELBUFSIZE 3072 #define ERR (-1) diff -Nurd linux86.old/ld/writebin.c linux86/ld/writebin.c --- linux86.old/ld/writebin.c Tue Jan 28 22:34:04 2003 +++ linux86/ld/writebin.c Sun Aug 31 13:15:51 2003 @@ -1053,7 +1053,11 @@ } #else -PUBLIC void writebin(outfilename, argsepid, argbits32, argstripflag, arguzp) +#ifndef FUNCNAME +#define FUNCNAME writebin +#endif + +PUBLIC void FUNCNAME(outfilename, argsepid, argbits32, argstripflag, arguzp) char *outfilename; bool_pt argsepid; bool_pt argbits32; diff -Nurd linux86.old/libc/Makefile linux86/libc/Makefile --- linux86.old/libc/Makefile Wed Jan 29 19:56:20 2003 +++ linux86/libc/Makefile Sun Aug 31 15:01:03 2003 @@ -15,6 +15,10 @@ include Make.defs +ifeq ($(VERSION),) +include VERSION +endif + CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS) ############################################################################ diff -Nurd linux86.old/libc/misc/strtol.c linux86/libc/misc/strtol.c --- linux86.old/libc/misc/strtol.c Tue Apr 16 21:33:01 2002 +++ linux86/libc/misc/strtol.c Sat Sep 13 06:30:37 2003 @@ -66,8 +66,8 @@ /* If base==0 and the string begins with "0x" then we're supposed to assume that it's hexadecimal (base 16). */ - else - if (base==0 && *nptr=='0') + if (base==0 && *nptr=='0') + { if (toupper(*(nptr+1))=='X') { base=16; @@ -80,7 +80,7 @@ base=8; nptr++; } - + } /* If base is still 0 (it was 0 to begin with and the string didn't begin with "0"), then we are supposed to assume that it's base 10 */ diff -Nurd linux86.old/libc/string/string.c linux86/libc/string/string.c --- linux86.old/libc/string/string.c Mon Aug 5 20:50:41 2002 +++ linux86/libc/string/string.c Mon Aug 18 08:17:22 2003 @@ -42,10 +42,11 @@ #ifdef PARANOID push es - push ds ; Im not sure if this is needed, so just in case. + push ds ! Im not sure if this is needed, so just in case. pop es cld -#endif ! This is almost the same as memchr, but it can +#endif + ! This is almost the same as memchr, but it can ! stay as a special. #if __FIRST_ARG_IN_AX__ diff -Nurd linux86.old/makefile.in linux86/makefile.in --- linux86.old/makefile.in Sat Aug 3 22:45:50 2002 +++ linux86/makefile.in Sun Aug 31 14:45:08 2003 @@ -18,19 +18,20 @@ LDFLAGS = MAKEARG =CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \ PREFIX=$(PREFIX) LIBPRE='$(LIBPRE)' LIBDIR='$(LIBDIR)' \ - BINDIR='$(BINDIR)' ANSI='$(ANSI)' VERSION='$(VERSION)' + BINDIR='$(BINDIR)' ANSI='$(ANSI)' MAKEC=$(MAKE) -C MAKEX= # This is only allowed on Linux because make needs to know how to look # inside an archive to get the last modified times of the component .o -# files. This should be fine for Linux, but it won't be for AIX. +# files. This should be fine for Linux, but it won't be for AIX etc. +# Unfortunatly it's even _required_ for linux because some versions +# of Redhat have a broken standard ar command. #ifdef __linux__ AR=ar86 #endif #ifdef __GNUC__ -# unproto is yukky, I've included '-w' in the local makefile. WALL =-Wall -Wtraditional -Wshadow -Wid-clash-14 -Wpointer-arith \ -Wcast-qual -Wcast-align -Wconversion -Waggregate-return \ @@ -68,6 +69,11 @@ #endif # Alter these if for some reason you don't want this done as root. +#ifdef __CYGWIN__ +INDAT=-m 644 +INEXE=-m 755 +INSCR=-m 755 +#else #ifdef __BCC__ INDAT=-o root -g root -m 644 INEXE=-o root -g root -m 755 @@ -77,6 +83,13 @@ INEXE=-o root -g root -m 755 -s INSCR=-o root -g root -m 755 #endif +#endif + +#ifdef __CYGWIN__ +EXE=.exe +#else +EXE= +#endif #ifdef GNUMAKE all: check_config bcc cpp unproto copt as86 ar86 ld86 objdump86 \ @@ -130,44 +143,47 @@ #endif bcc: bindir + echo '#define VERSION "'"$(VERSION)"'"' > bcc/version.h $(MAKEC) bcc $(MAKEARG) BCCARCH='$(BCCARCH)' bcc ncc bcc-cc1 - cp -p bcc/bcc bin/Bcc - cp -p bcc/ncc bin/ncc - cp -p bcc/bcc-cc1 lib/bcc-cc1 + cp -p bcc/bcc$(EXE) bin/Bcc$(EXE) + cp -p bcc/ncc$(EXE) bin/ncc$(EXE) + cp -p bcc/bcc-cc1$(EXE) lib/bcc-cc1$(EXE) cpp: bindir $(MAKEC) cpp $(MAKEARG) bcc-cpp - cp -p cpp/bcc-cpp lib/bcc-cpp + cp -p cpp/bcc-cpp$(EXE) lib/bcc-cpp$(EXE) unproto: bindir $(MAKEC) unproto $(MAKEARG) unproto - cp -p unproto/unproto lib/unproto + cp -p unproto/unproto$(EXE) lib/unproto$(EXE) copt: bindir $(MAKEC) copt $(MAKEARG) copt - cp -p copt/copt lib/copt + cp -p copt/copt$(EXE) lib/copt$(EXE) cp -p copt/rules.* lib/. as86: bindir + echo '#define VERSION "'"$(VERSION)"'"' > as/version.h $(MAKEC) as $(MAKEARG) all - cp -p as/as86 bin/as86 + cp -p as/as86$(EXE) bin/as86$(EXE) cp -p as/as86_encap bin/as86_encap ar86: bindir $(MAKEC) ar $(MAKEARG) all - cp -p ar/ar86 bin/ar86 + cp -p ar/ar86$(EXE) bin/ar86$(EXE) ld86: bindir + echo '#define VERSION "'"$(VERSION)"'"' > ld/version.h $(MAKEC) ld $(MAKEARG) ld86 - cp -p ld/ld86 bin/ld86 + cp -p ld/ld86$(EXE) bin/ld86$(EXE) ld86r: bindir $(MAKEC) ld $(MAKEARG) ld86r - cp -p ld/ld86r bin/ld86r + cp -p ld/ld86r$(EXE) bin/ld86r$(EXE) objdump86: bindir $(MAKEC) ld $(MAKEARG) objdump86 - cp -p ld/objdump86 bin/objdump86 + cp -p ld/objdump86$(EXE) bin/objdump86$(EXE) elksemu: bindir #ifndef __AS386_16__ @@ -196,19 +212,19 @@ install-bcc: bcc cpp unproto copt as86 ar86 ld86 objdump86 install -d $(DISTBIN) $(DISTLIB) $(DISTLIB)/i86 - install $(INEXE) bin/Bcc $(DISTBIN)/bcc - install $(INSCR) bin/as86_encap $(DISTBIN)/as86_encap - install $(INEXE) bin/as86 $(DISTBIN)/as86 - install $(INEXE) bin/ar86 $(DISTBIN)/ar86 - install $(INEXE) bin/ld86 $(DISTBIN)/ld86 - install $(INEXE) bin/objdump86 $(DISTBIN)/objdump86 - install $(INEXE) bin/objdump86 $(DISTBIN)/nm86 - install $(INEXE) bin/objdump86 $(DISTBIN)/size86 - install $(INEXE) lib/bcc-cc1 $(DISTLIB)/bcc-cc1 - install $(INEXE) lib/bcc-cpp $(DISTLIB)/bcc-cpp - install $(INEXE) lib/unproto $(DISTLIB)/unproto - install $(INEXE) lib/copt $(DISTLIB)/copt - install $(INDAT) lib/rules.* $(DISTLIB)/i86 + install $(INEXE) bin/Bcc$(EXE) $(DISTBIN)/bcc$(EXE) + install $(INSCR) bin/as86_encap $(DISTBIN)/as86_encap + install $(INEXE) bin/as86$(EXE) $(DISTBIN)/as86$(EXE) + install $(INEXE) bin/ar86$(EXE) $(DISTBIN)/ar86$(EXE) + install $(INEXE) bin/ld86$(EXE) $(DISTBIN)/ld86$(EXE) + install $(INEXE) bin/objdump86$(EXE) $(DISTBIN)/objdump86$(EXE) + install $(INEXE) bin/objdump86$(EXE) $(DISTBIN)/nm86$(EXE) + install $(INEXE) bin/objdump86$(EXE) $(DISTBIN)/size86$(EXE) + install $(INEXE) lib/bcc-cc1$(EXE) $(DISTLIB)/bcc-cc1$(EXE) + install $(INEXE) lib/bcc-cpp$(EXE) $(DISTLIB)/bcc-cpp$(EXE) + install $(INEXE) lib/unproto$(EXE) $(DISTLIB)/unproto$(EXE) + install $(INEXE) lib/copt$(EXE) $(DISTLIB)/copt$(EXE) + install $(INDAT) lib/rules.* $(DISTLIB)/i86 @test ! -f $(DISTLIB)/as86 || rm -f $(DISTLIB)/as86 @test ! -f $(DISTLIB)/ld86 || rm -f $(DISTLIB)/ld86 @@ -325,12 +341,13 @@ ############################################################################## -install-other: +install-other: other @for i in $(OTHERS) ; do \ $(MAKEC) $$i BCC=ncc DIST=$(DIST) PREFIX=$(PREFIX) install || exit 1 ; \ done other: + echo '#define VERSION "'"$(VERSION)"'"' > bootblocks/version.h @for i in $(OTHERS) ; do \ $(MAKEC) $$i BCC=ncc DIST=$(DIST) PREFIX=$(PREFIX) || exit 1; \ done @@ -344,5 +361,9 @@ rm -f include rm -f makec rm -f `find $(CLEANLIST) -type l -print` + rm -f bcc/version.h + rm -f as/version.h + rm -f ld/version.h + rm -f bootblocks/version.h ############################################################################## diff -Nurd linux86.old/unproto/Makefile linux86/unproto/Makefile --- linux86.old/unproto/Makefile Sat Jun 8 09:03:22 2002 +++ linux86/unproto/Makefile Sun Aug 31 13:48:15 2003 @@ -83,13 +83,13 @@ CFLAGS = -O LDFLAGS = -CCFLAGS = $(CFLAGS) -w $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -DREOPEN +CCFLAGS = $(CFLAGS) $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -DREOPEN #CFLAGS = -O $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -p -Dstatic= #CFLAGS = -g $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -DDEBUG $(PROG): $(OBJECTS) - $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $^ $(MALLOC) + $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(MALLOC) .c.o: $(CC) $(CCFLAGS) -c $< -o $@ diff -Nurd linux86.old/unproto/unproto.c linux86/unproto/unproto.c --- linux86.old/unproto/unproto.c Thu Dec 5 00:45:55 2002 +++ linux86/unproto/unproto.c Sun Aug 31 13:45:36 2003 @@ -146,12 +146,12 @@ /* Application-specific stuff */ -#include "vstring.h" -#ifdef _AIX +#ifdef __STDC__ #include #else #include "stdarg.h" #endif +#include "vstring.h" #include "token.h" #include "error.h" #include "symbol.h" diff -Nurd linux86.old/bootblocks/boot_win.c linux86/bootblocks/boot_win.c --- linux86.old/bootblocks/boot_win.c Tue Jul 29 21:19:19 2003 +++ linux86/bootblocks/boot_win.c Sun Sep 14 12:42:22 2003 @@ -34,6 +34,7 @@ main() { int i, rv; + int floppy_only = 0; reset_screen(); cprintf("...\n"); @@ -46,20 +47,25 @@ if (rv != 0 || bs_buf[510] != 0x55 || bs_buf[511] != (char)0xAA) { cprintf("Hard disk not bootable.\n"); - boot_floppy(); + floppy_only = 1; } - for(rv=-1, i=0x1BE; i<0x1FE; i+= 16) { - if (bs_buf[i] == (char)0x80) - rv = 0; - } + if (!floppy_only) { + for(rv=-1, i=0x1BE; i<0x1FE; i+= 16) { + if (bs_buf[i] == (char)0x80) + rv = 0; + } - if (rv) { - cprintf("Hard disk has no active partition.\n"); - boot_floppy(); + if (rv) { + cprintf("Hard disk has no active partition.\n"); + floppy_only = 1; + } } - cprintf("Press return to skip hard disk boot: "); + if (floppy_only) + cprintf("Press return to wipe MBR: "); + else + cprintf("Press return to skip hard disk boot: "); __set_es(0x40); for(i=0; ; i++) { @@ -67,14 +73,17 @@ while (tv == __deek_es(0x6c)) if (kbhit()) { getch(); - cprintf(" Skipping HD.\n"); + cprintf("\n"); goto break_break; } if (i%10 == 0) cprintf("."); if (i>= 18*5) { - cprintf(" Booting HD.\n"); - boot_hd(); + cprintf(" Booting.\n"); + if(floppy_only) + boot_floppy(); + else + boot_hd(); } } break_break:; diff -Nurd linux86.old/bootblocks/monitor.c linux86/bootblocks/monitor.c --- linux86.old/bootblocks/monitor.c Sat Feb 1 18:03:22 2003 +++ linux86/bootblocks/monitor.c Sun Aug 31 14:40:58 2003 @@ -1,5 +1,6 @@ #include "monitor.h" +#include "version.h" char command_buf[256]; @@ -143,9 +144,7 @@ #else printf(" boot monitor"); #endif -#ifdef VERSION printf(", Version %s", VERSION); -#endif printf(".\n"); cpu_check();