Win16

From Lazarus wiki
Revision as of 21:15, 10 December 2017 by Nickysn (talk | contribs) (→‎Overview)
Jump to navigationJump to search

Overview

A Win16 cross compiler is currently being developed in FPC trunk (the development version). It targets Windows 3.0 or later.

Requirements

FPC trunk

The compiler is a cross compiler that runs at least on Windows (both x86 and x64), Linux, and Mac OS X. For compiling programs, it needs:

  • the Open Watcom linker - WLINK
  • the Open Watcom library manager - WLIB
  • the Netwide Assembler - NASM

In theory it should be able to run on any platform, supported by FPC, where NASM and the Open Watcom tools are available. This includes DOS via the GO32V2 extender. However, because the Watcom tools for DOS are compiled with a different extender, there are some issues related to long file names and the passing of long command line arguments.

Building a snapshot manually

  • make sure nasm, wlink and wlib are in your path
  • checkout fpc trunk:
svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc
  • enter the fpc directory and build the compiler with the following command (replace /usr/bin/ppc386 with the full path to the stable (3.0.4) FPC compiler binary; replace -WmLarge with -WmMedium, -WmCompact or -WmSmall if you want to use another memory model):
make clean all OS_TARGET=win16 CPU_TARGET=i8086 OPT="-CX -XXs" CROSSOPT=-WmLarge BINUTILSPREFIX= PP=/usr/bin/ppc386
  • install the snapshot (replace linux and i386 with the OS and CPU you're using; replace INSTALL_PREFIX with the directory you want the snapshot installed):
make crossinstall OS_SOURCE=linux CPU_SOURCE=i386 OS_TARGET=win16 CPU_TARGET=i8086 PP=compiler/ppcross8086 CROSSOPT=-WmLarge \
    BINUTILSPREFIX= INSTALL_PREFIX=/home/blablabla/fpc-i8086/snapshot-win16/large OPT="-CX -XXs"