diff -ur --new-file ../twin152-clean/src-1.5.2/win/Comm.c ./src-1.5.2/win/Comm.c --- ../twin152-clean/src-1.5.2/win/Comm.c Thu Feb 22 15:15:11 1996 +++ ./src-1.5.2/win/Comm.c Wed Mar 6 12:13:10 1996 @@ -627,6 +627,50 @@ port.c_cc[VTIME] = 0; LOGSTR((LF_COMM,"COMM: SetCommState: baudrate %d\n",lpdcb->BaudRate)); + +#ifdef __FreeBSD__ + switch (lpdcb->BaudRate) { + case 110: + case CBR_110: + cfsetspeed(&port,B110); + break; + case 300: + case CBR_300: + cfsetspeed(&port,B300); + break; + case 600: + case CBR_600: + cfsetspeed(&port,B600); + break; + case 1200: + case CBR_1200: + cfsetspeed(&port,B1200); + break; + case 2400: + case CBR_2400: + cfsetspeed(&port,B2400); + break; + case 4800: + case CBR_4800: + cfsetspeed(&port,B4800); + break; + case 9600: + case CBR_9600: + cfsetspeed(&port,B9600); + break; + case 19200: + case CBR_19200: + cfsetspeed(&port,B19200); + break; + case 38400: + case CBR_38400: + cfsetspeed(&port,B38400); + break; + default: + pdevsw.commerror = IE_BAUDRATE; + return -1; + } +#else port.c_cflag &= ~CBAUD; switch (lpdcb->BaudRate) { case 110: @@ -669,6 +713,7 @@ pdevsw.commerror = IE_BAUDRATE; return -1; } +#endif LOGSTR((LF_COMM,"COMM: SetCommState: bytesize %d\n",lpdcb->ByteSize)); port.c_cflag &= ~CSIZE; @@ -751,7 +796,11 @@ return -1; } +#ifdef __FreeBSD__ + switch (cfgetospeed(&port)) { +#else switch (port.c_cflag & CBAUD) { +#endif case B110: lpdcb->BaudRate = 110; break; diff -ur --new-file ../twin152-clean/src-1.5.2/win/Exec.c ./src-1.5.2/win/Exec.c --- ../twin152-clean/src-1.5.2/win/Exec.c Thu Feb 22 15:14:00 1996 +++ ./src-1.5.2/win/Exec.c Wed Mar 6 12:13:10 1996 @@ -33,7 +33,7 @@ #include #include #include -#ifndef LINUX +#if !defined(LINUX) && !defined(__FreeBSD__) #include #endif @@ -186,6 +186,9 @@ int ret; TWIN_RegisterGPFSignal(SIGILL); +#ifdef __FreeBSD__ + TWIN_RegisterGPFSignal(SIGBUS); +#endif TWIN_RegisterGPFSignal(SIGSEGV); TWIN_RegisterGPFSignal(SIGFPE); diff -ur --new-file ../twin152-clean/src-1.5.2/win/ExecFreeBSD.c ./src-1.5.2/win/ExecFreeBSD.c --- ../twin152-clean/src-1.5.2/win/ExecFreeBSD.c Wed Dec 31 19:00:00 1969 +++ ./src-1.5.2/win/ExecFreeBSD.c Wed Mar 6 12:13:11 1996 @@ -0,0 +1,286 @@ +/* +* ExecFreeBSD.c +* +* @(#)ExecFreeBSD.c 1.5 1/27/96 16:09:54 /users/sccs/src/win/s.ExecFreeBSD.c +* +* Copyright (c) 1995-1996, Willows Software Inc. All rights reserved. +* +*/ + + +/* + * This file is part of Willows Twin. + * + * This software is distributed under the terms of the Willows Twin + * Public License as published by Willows Software, Inc. This software + * may not be redistributed without the express written permission of + * Willows Software, Inc. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Willows Twin Public License for more details. + * + * You should have received a copy of the Willows Twin Public License + * along with this software; if not, contact Willows Software, Inc., + * 10295 Saratoga Ave, Saratoga, CA 95070 USA. + * + * http://www.willows.com + * (408) 777-1820 -- VOICE + * (408) 777-1825 -- FAX + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "windows.h" + +#include "DPMI.h" +#include "kerndef.h" /* BINADDR */ +#include "BinTypes.h" /* ENV structure */ +#include "Log.h" +#include "dos.h" +#include "Exec.h" + +#define STACK_DWORDS 0x4000 + +static struct sigaction sact; +static unsigned long TWIN_Stack[STACK_DWORDS]; + +#define sys_modify_ldt(a, b) syscall(123,1,(void *)a,(int)b) +#define sys_read_ldt(a, b) syscall(123,2,(void *)a,(int)b) + +/* forward declaration */ +struct TWIN_i386_context_s *get_regs __P((struct sigframe *)); +int set_regs __P((struct TWIN_i386_context_s *, struct sigcontext *)); + +int sysi86(int func, void *data) +{ + struct ssd *req; + unsigned short wFlags; + long buffer[2]; + struct segment_descriptor *descr = (struct segment_descriptor *)buffer; + int limit, limit_in_pages, entry, seg_32bit, type, read_only; + + if (func == SI86DSCR) + { + req = (struct ssd *) data; + wFlags = (unsigned short) req->acc1; + wFlags |= ((unsigned short) req->acc2 << 8); + + entry = (unsigned int)(req->sel >> 3); + + /* special test for DN_FREE, we can't handle it */ + if (req->bo == 0 && wFlags == 0 && req->ls == 0) + { +#if 0 + printf("would free %d\n", entry); +#endif + return (0); + } + + if (req->ls == 0) + { + limit = 0; + limit_in_pages = 0; + } + else if ((req->ls - 1) > 0xFFFFF || (wFlags & DF_PAGES)) + { +#if 0 + fprintf(stderr,"should be PAGES\n"); +#endif + limit = (req->ls - 1) >> 12; + limit_in_pages = 1; + } + else + { + limit = req->ls - 1; + limit_in_pages = 0; + } + + seg_32bit = (wFlags & DF_32)?1:0; + +#define MODIFY_LDT_CONTENTS_DATA SDT_MEMRWA +#define MODIFY_LDT_CONTENTS_STACK SDT_MEMRWDA +#define MODIFY_LDT_CONTENTS_CODE SDT_MEMERA + + if (wFlags & DF_CODE) + type = MODIFY_LDT_CONTENTS_CODE; + else if (wFlags & DF_EXPANDDOWN) + type = MODIFY_LDT_CONTENTS_STACK; + else + type = MODIFY_LDT_CONTENTS_DATA; + + read_only = (wFlags & DF_DWRITEABLE) ? 0 : 1; + + descr->sd_lolimit = limit & 0xffff; + descr->sd_lobase = req->bo & 0xffffff; + descr->sd_type = type; + descr->sd_dpl = SEL_UPL; + descr->sd_p = (wFlags & DF_PRESENT) ? 1 : 0; + descr->sd_hilimit = (limit >> 16) & 0xf; + descr->sd_xx = 0; + descr->sd_def32 = seg_32bit ? 1 : 0; + descr->sd_gran = limit_in_pages; + descr->sd_hibase = (req->bo >> 24) & 0xff; +#if 0 +fprintf(stderr,"sel %d entry %d lolim 0x%x lobase 0x%x type %d sd_p %d hilim 0x%x def32 %d hibas 0x%x\n",req->sel,entry,descr->sd_lolimit,descr->sd_lobase,descr->sd_type,descr->sd_p,descr->sd_hilimit,descr->sd_def32,descr->sd_hibase); +#endif + limit = i386_set_ldt(entry, (union descriptor *)descr, 1); + if (limit < 0) { + perror ("i386_set_ldt"); + return (1); + } else + return (0); + } + else + return -1; +} + +static void +TWIN_GPFSigHandler(int sig, int code, struct sigcontext *sc_p) +{ + struct TWIN_i386_context_s *sc = get_regs ((struct sigframe *)&sig); + + TWIN_GPFHandler(sig, sc); + TWIN_ValidateSegmentRegisters(sc); + set_regs (sc, sc_p); +} + +static void +TWIN_DebugSigHandler (int sig, int code, struct sigcontext *sc_p) +{ + struct TWIN_i386_context_s *sc = get_regs ((struct sigframe *)&sig); + + if (sig == SIGTRAP) + { + sc_p->sc_eip--; + sc->eip--; + } + + /* this is schizophrenic, wine_debug wants a sigcontext * !! */ + wine_debug(sig, sc_p); + TWIN_ValidateSegmentRegisters(sc); + set_regs (sc, sc_p); +} + +static int altstackdefined = 0; + +int +TWIN_RegisterGPFSignal(int sig) +{ + if (!altstackdefined) + { + struct sigaltstack ss; + + altstackdefined = 1; + ss.ss_sp = (char *)TWIN_Stack; + ss.ss_size = sizeof(TWIN_Stack); + ss.ss_flags = 0; + if (sigaltstack(&ss, NULL) < 0) + perror("sigaltstack"); + } + + sact.sa_handler = TWIN_GPFSigHandler; + sact.sa_flags = SA_ONSTACK; + return sigaction(sig, &sact, NULL); +} + +int +TWIN_RegisterDebugSignal(int sig) +{ + if (!altstackdefined) + { + struct sigaltstack ss; + + altstackdefined = 1; + ss.ss_sp = (char *)TWIN_Stack; + ss.ss_size = sizeof(TWIN_Stack); + ss.ss_flags = 0; + if (sigaltstack(&ss, NULL) < 0) + perror("sigaltstack"); + } + + sact.sa_handler = TWIN_DebugSigHandler; + sact.sa_flags = SA_ONSTACK; + return sigaction(sig, &sact, NULL); +} + +struct TWIN_i386_context_s * +get_regs (struct sigframe *sf_p) +{ + static struct TWIN_i386_context_s my_c_s; + struct sigcontext *sc_p = sf_p->sf_scp; + int signal = sf_p->sf_signum; + + /* of course, the structures are different */ + /* FreeBSD doesn't save the gs or fs reg */ +#ifdef USE_SHORT + my_c_s.gs = my_c_s.__gsh = 0; + my_c_s.fs = my_c_s.__fsh = 0; + my_c_s.es = sc_p->sc_es & 0xffff; + my_c_s.__esh = sc_p->sc_es >> 16; + my_c_s.ds = sc_p->sc_ds & 0xffff; + my_c_s.__dsh = sc_p->sc_ds >> 16; + my_c_s.cs = sc_p->sc_cs & 0xffff; + my_c_s.__csh = sc_p->sc_cs >> 16; + my_c_s.ss = sc_p->sc_ss & 0xffff; + my_c_s.__ssh = sc_p->sc_ss >> 16; +#else + *((int *)&my_c_s.gs) = 0; + *((int *)&my_c_s.fs) = 0; + *((int *)&my_c_s.es) = sc_p->sc_es; + *((int *)&my_c_s.ds) = sc_p->sc_ds; + *((int *)&my_c_s.cs) = sc_p->sc_cs; + *((int *)&my_c_s.ss) = sc_p->sc_ss; +#endif + my_c_s.edi = sc_p->sc_edi; + my_c_s.esi = sc_p->sc_esi; + my_c_s.ebp = sc_p->sc_ebp; + my_c_s.esp = sc_p->sc_esp; + my_c_s.ebx = sc_p->sc_ebx; + my_c_s.edx = sc_p->sc_edx; + my_c_s.ecx = sc_p->sc_ecx; + my_c_s.eax = sc_p->sc_eax; + /* the only thing not always passed by sendsig is trapno */ + /* but it doesn't seem to be used anyway :-) */ + if (signal == SIGILL) + my_c_s.trapno = sf_p->sf_code; + else + my_c_s.trapno = 0; + my_c_s.err = (unsigned long)sf_p->sf_addr; + my_c_s.eip = sc_p->sc_pc; + my_c_s.eflags = sc_p->sc_ps; + my_c_s.esp_at_signal = sc_p->sc_isp; + + return (&my_c_s); +} + +/* need to re-set the registers on the stack after handling a signal */ +int +set_regs (struct TWIN_i386_context_s * my_c_s, struct sigcontext *sc_p) +{ + + sc_p->sc_es = *((int *)&my_c_s->es); + sc_p->sc_ds = *((int *)&my_c_s->ds); + sc_p->sc_cs = *((int *)&my_c_s->cs); + sc_p->sc_ss = *((int *)&my_c_s->ss); + sc_p->sc_edi = my_c_s->edi; + sc_p->sc_esi = my_c_s->esi; + sc_p->sc_ebp = my_c_s->ebp; + sc_p->sc_esp = my_c_s->esp; + sc_p->sc_ebx = my_c_s->ebx; + sc_p->sc_edx = my_c_s->edx; + sc_p->sc_ecx = my_c_s->ecx; + sc_p->sc_eax = my_c_s->eax; + sc_p->sc_pc = my_c_s->eip; + /* sc_p->sc_ps = my_c_s->eflags; XXX I'm confused?? -smpatel */ + return (0); +} diff -ur --new-file ../twin152-clean/src-1.5.2/win/ExecUtl.S ./src-1.5.2/win/ExecUtl.S --- ../twin152-clean/src-1.5.2/win/ExecUtl.S Thu Feb 22 15:16:12 1996 +++ ./src-1.5.2/win/ExecUtl.S Wed Mar 6 12:13:11 1996 @@ -100,10 +100,21 @@ popl %ebp ret #else +#ifdef __FreeBSD__ +#define _LogProcName _LogProcName@PLT +#define _TWIN_GetReturnThunkSel _TWIN_GetReturnThunkSel@PLT +#define _GetEnvpGlobal32 _GetEnvpGlobal@PLT +#define _GetSelectorBase _GetSelectorBase@PLT +#define debuggerbreak _debuggerbreak +#define native_ss _native_ss +#define envp_global _envp_global +#define LDT _LDT +#else #define _LogProcName LogProcName #define _TWIN_GetReturnThunkSel TWIN_GetReturnThunkSel #define _GetEnvpGlobal32 GetEnvpGlobal #define _GetSelectorBase GetSelectorBase +#endif /* __FreeBSD__ */ #endif /* ENV structure */ @@ -173,12 +184,25 @@ movw %si,ESI(%ebx) movw %di,EDI(%ebx) /* restore saved 16-bit ds */ +#ifdef __FreeBSD__ + movw %es, %ax + movw %ax, ES(%ebx) + movw %ss, %ax + movw %ax, SS(%ebx) + movw %fs, %ax + movw %ax, FS(%ebx) + movw %gs, %ax + movw %ax, GS(%ebx) + popw %ax /* -0 */ + movw %ax,DS(%ebx) +#else popw %ax /* -0 */ movw %ax,DS(%ebx) movw %es,ES(%ebx) movw %ss,SS(%ebx) movw %fs,FS(%ebx) movw %gs,GS(%ebx) +#endif /* push 32-bit flags */ pushf /* -4 */ @@ -431,7 +455,11 @@ /* push short bx */ pushw EBX(%ebx) +#ifdef __FreeBSD__ + pushw EAX(%ebx) /* set */ +#else movw EAX(%ebx),%ax /* set */ +#endif movw ECX(%ebx),%cx /* set */ movw EDX(%ebx),%dx /* set */ movw ESI(%ebx),%si /* set */ @@ -444,9 +472,19 @@ popf /* flags set 16-bit pop */ +#ifdef __FreeBSD__ + movw ES(%ebx), %ax + movw %ax, %es + movw FS(%ebx), %ax + movw %ax, %fs + movw DS(%ebx), %ax + movw %ax, %ds + popw %ax +#else movw ES(%ebx),%es movw FS(%ebx),%fs movw DS(%ebx),%ds +#endif popw %bx /* bx set */ diff -ur --new-file ../twin152-clean/src-1.5.2/win/LoadLibrary.c ./src-1.5.2/win/LoadLibrary.c --- ../twin152-clean/src-1.5.2/win/LoadLibrary.c Thu Feb 22 15:14:15 1996 +++ ./src-1.5.2/win/LoadLibrary.c Wed Mar 6 12:13:11 1996 @@ -59,6 +59,10 @@ #endif #endif +#ifdef __FreeBSD__ +#define RTLD_LAZY (1) +#endif + #define LF_LIB LF_LOG extern HMODULE CreateModuleInstance(LPSTR); diff -ur --new-file ../twin152-clean/src-1.5.2/win/Makefile ./src-1.5.2/win/Makefile --- ../twin152-clean/src-1.5.2/win/Makefile Fri Feb 23 16:37:01 1996 +++ ./src-1.5.2/win/Makefile Wed Mar 6 14:43:55 1996 @@ -354,6 +354,13 @@ ln -s libtwin.so.$(VERSION).$(PATCHLEVEL) libtwin.so ln -s libtwin.so.$(VERSION).$(PATCHLEVEL) libtwin_sunos.so +# FreeBSD 2.x method uses lorder and tsort +libtwin_freebsd.so: $(ALLOBJ) $(TWINOBJ) + rm -f libtwin.so libtwin_freebsd.so libtwin.so.$(VERSION).$(PATCHLEVEL) + ${CCSHARE} $(LDSHARED) -o libtwin_freebsd.so.$(VERSION).$(PATCHLEVEL) \ + $(ALLOBJ) $(TWINOBJ) + ln -s libtwin_freebsd.so.$(VERSION).$(PATCHLEVEL) libtwin.so.$(VERSION).$(PATCHLEVEL) + ln -s libtwin_freebsd.so.$(VERSION).$(PATCHLEVEL) libtwin.so ########################################################################## # diff -ur --new-file ../twin152-clean/src-1.5.2/win/WinMain.c ./src-1.5.2/win/WinMain.c --- ../twin152-clean/src-1.5.2/win/WinMain.c Thu Feb 22 15:16:06 1996 +++ ./src-1.5.2/win/WinMain.c Wed Mar 6 12:13:11 1996 @@ -43,7 +43,9 @@ #include "Module.h" /* This is to determine whether this object file has been linked in */ +#ifndef __FreeBSD__ BOOL bIsXWin = TRUE; +#endif extern LPSTR strpbrkr(LPCSTR,LPCSTR); extern HANDLE InternalLoadLibrary(WORD,LPSTR,LPARAM); diff -ur --new-file ../twin152-clean/src-1.5.2/win/debugger/break.c ./src-1.5.2/win/debugger/break.c --- ../twin152-clean/src-1.5.2/win/debugger/break.c Thu Feb 22 15:16:17 1996 +++ ./src-1.5.2/win/debugger/break.c Wed Mar 6 13:25:22 1996 @@ -6,6 +6,9 @@ #ifdef linux #include #endif +#ifdef __FreeBSD__ +#include +#endif #include #include #include "db_disasm.h" diff -ur --new-file ../twin152-clean/src-1.5.2/win/debugger/db_disasm.c ./src-1.5.2/win/debugger/db_disasm.c --- ../twin152-clean/src-1.5.2/win/debugger/db_disasm.c Thu Feb 22 15:16:19 1996 +++ ./src-1.5.2/win/debugger/db_disasm.c Wed Mar 6 13:25:33 1996 @@ -72,6 +72,9 @@ #endif #include #include +#ifdef __FreeBSD__ +typedef int boolean_t; +#endif #include "db_disasm.h" #include "debugger.h" #include "stdarg.h" diff -ur --new-file ../twin152-clean/src-1.5.2/win/debugger/function.c ./src-1.5.2/win/debugger/function.c --- ../twin152-clean/src-1.5.2/win/debugger/function.c Thu Feb 22 15:16:22 1996 +++ ./src-1.5.2/win/debugger/function.c Wed Mar 6 13:25:44 1996 @@ -4,6 +4,9 @@ #include #include #include +#ifdef __FreeBSD__ +typedef int boolean_t; +#endif #include "debugger.h" #include "db_disasm.h" #include "regpos.h" diff -ur --new-file ../twin152-clean/src-1.5.2/win/debugger/info.c ./src-1.5.2/win/debugger/info.c --- ../twin152-clean/src-1.5.2/win/debugger/info.c Thu Feb 22 15:16:20 1996 +++ ./src-1.5.2/win/debugger/info.c Wed Mar 6 13:26:05 1996 @@ -7,6 +7,9 @@ #include #include #include +#ifdef __FreeBSD__ +typedef int boolean_t; +#endif #include "debugger.h" #include "db_disasm.h" #include "regpos.h" diff -ur --new-file ../twin152-clean/src-1.5.2/win/intp32/hsw_interp.h ./src-1.5.2/win/intp32/hsw_interp.h --- ../twin152-clean/src-1.5.2/win/intp32/hsw_interp.h Thu Feb 22 15:13:33 1996 +++ ./src-1.5.2/win/intp32/hsw_interp.h Wed Mar 6 12:13:47 1996 @@ -734,7 +734,7 @@ } Interp_ENV; #endif -#if defined(X386) +#if defined(X386) || defined(__FreeBSD__) typedef struct keyENV{ union { unsigned int ds; @@ -1070,7 +1070,7 @@ } Interp_VAR; #endif -#if defined(X386) +#if defined(X386) || defined(__FreeBSD__) typedef struct { unsigned char *seg_regs[7]; union { diff -ur --new-file ../twin152-clean/src-1.5.2/win/make_thunk.c ./src-1.5.2/win/make_thunk.c --- ../twin152-clean/src-1.5.2/win/make_thunk.c Thu Feb 22 15:14:42 1996 +++ ./src-1.5.2/win/make_thunk.c Wed Mar 6 12:13:48 1996 @@ -180,7 +180,7 @@ #define THUNK_MAGIC_OFFSET 13 #endif -#ifdef X386 +#if defined(X386) || defined(__FreeBSD__) char thunk_template[] = { 0x90, 0x53, /* PUSH EBX */ 0x90, 0xbb, /* MOV EBX, 0 */ @@ -401,7 +401,7 @@ wSel = HIWORD(targ); wOffset = LOWORD(targ); -#if defined(X386) || defined(dec) +#if defined(X386) || defined(dec) || defined (__FreeBSD__) make_native_thunk_template = (LPDWORD) thunk_template; #endif if (GetSelectorType(wSel) == TRANSFER_BINARY){ @@ -426,7 +426,7 @@ /* now fill in the "special" pieces */ thunk[CUR_ENV_OFF] = (DWORD) &envp_global; thunk[TARG_OFF] = targ; -#ifdef X386 +#if defined(X386) || defined (__FreeBSD__) thunk[CONV_OFF] = (conv - (DWORD)&thunk[CONV_OFF+1]); #else thunk[CONV_OFF] = conv; diff -ur --new-file ../twin152-clean/src-1.5.2/win/makeinclude/Makefile.freebsd ./src-1.5.2/win/makeinclude/Makefile.freebsd --- ../twin152-clean/src-1.5.2/win/makeinclude/Makefile.freebsd Wed Dec 31 19:00:00 1969 +++ ./src-1.5.2/win/makeinclude/Makefile.freebsd Wed Mar 6 15:02:09 1996 @@ -0,0 +1,30 @@ +######################################################################## +# @(#)Makefile.freebsd 1.0 3/6/96 2:05:18 +# +# FreeBSD compiler and platform settings. +# +# Copyright (c) 1995, Willows Software Inc. All rights reserved. +# +# +# TWINDIR must be set to location of sources. +# ex: TWINDIR=/users/johndoe/src/win +# +######################################################################## + +CC = gcc $(WIN_CFLAGS) -fwritable-strings +C++ = g++ $(WIN_CFLAGS) -fwritable-strings +CCOPTIM = -O2 +CCSHARE = $(CC) +PICFLAG = -fPIC +DEPEND = +CPP = /usr/bin/cpp +LD = ld +AR = ar +MAKE = make +RC = rc +MDC = mdc +STRIP = touch +SHELL = /bin/sh + +include $(TWINDIR)/makeinclude/Makeinclude.$(TARGET) + diff -ur --new-file ../twin152-clean/src-1.5.2/win/makeinclude/Makeinclude.freebsd ./src-1.5.2/win/makeinclude/Makeinclude.freebsd --- ../twin152-clean/src-1.5.2/win/makeinclude/Makeinclude.freebsd Wed Dec 31 19:00:00 1969 +++ ./src-1.5.2/win/makeinclude/Makeinclude.freebsd Wed Mar 6 14:26:06 1996 @@ -0,0 +1,64 @@ +######################################################################### +# @(#)Makeinclude.freebsd 1.0 3/6/96 2:05:18 +# +# FreeBSD platform specific info. +# +# Copyright (c) 1995, Willows Software Inc. All rights reserved. +# +######################################################################### + + +INCLUDES = -I/usr/X11R6/include +XLIB = -L/usr/X11R6/lib + +RANLIB = ranlib +EXTRALIB = -lX11 -lm +SHARELIB = + +WINEXE = win486 + + +PLATFORM = -DX386 + +CPUTYPE = CPU + +WIN_VERSION_XXX = $(WIN_VERSION)so +WIN_VERSION_XX = $(WIN_VERSION_XXX:aoutso=.a) +WIN_VERSION_X = $(WIN_VERSION_XX:so=_freebsd.so) +LIBTWIN = libtwin$(WIN_VERSION_X) + +WIN_CFLAGS_XX=$(WIN_VERSION)so +WIN_CFLAGS_X =$(WIN_CFLAGS_XX:aoutso=) +WIN_CFLAGS =$(WIN_CFLAGS_X:so=$(PICFLAG)) + +CCSHARE = $(LD) +LDSHARED = -Bshareable + +EXECSUFFIX=FreeBSD + +# Defines for use in porting applications + +TWIN_INCPATH = -I$(TWINDIR)/$(TARGET)/include +TWIN_LIBPATH = -L$(TWINDIR)/$(TARGET)/lib/$(TWINDBG) + + +# Special options to help with building Native DLLs +# First, the command and options for compiling individual .c modules. + +DLL_CC = $(CC) +DLL_CCOPT = $(PICFLAG) + +# Next, the command and options for linking objects into shared libraries. + +DLL_LD = $(CC) +DLL_LDOPT = -shared -Wl,-Bsymbolic +DLL_LDLIB = -ltwin -lc -ldll + +# Platform specific options needed for running mdc. + +DLL_MDCOPT = + +# Finally, the extension we use for DLLs on this platform. + +DLL_EXT = so + diff -ur --new-file ../twin152-clean/src-1.5.2/win/xdos/fn_36.c ./src-1.5.2/win/xdos/fn_36.c --- ../twin152-clean/src-1.5.2/win/xdos/fn_36.c Thu Feb 22 15:11:22 1996 +++ ./src-1.5.2/win/xdos/fn_36.c Wed Mar 6 12:13:52 1996 @@ -52,7 +52,12 @@ #include #include #else +#if defined(__FreeBSD__) +#include +#include +#else #include +#endif /* __FreeBSD__ */ #endif /* NETWARE */ #endif /* dec */ #endif /* solar, sco, ibm, IRIX */