How to cross-compile Win32 to OS/2? lazarus / 11-Options ---------------------------------------------------------------------- march · 2011-01-11 07:54 I have just developed a Lazarus application in Windows XP. Now I must make a version for OS/2 (eCS). It should be one of the easier setups because of similarity with Windows and the same i386 processor. I have spent the last few days searching and looking over all the FAQs, documents and messages that I can find about cross-compiling. Many of these seem to be out of date, or deal only with Linux as host. There are so many conflicting details that I am confused and do not know what should apply to Lazarus 0.9.28.2 with Win32 host. There is an fpc\2.2.4\source\rtl\os2 directory which contains a Makefile. Should I be using this? I tried running make.exe here, but got error messages right away: D:\FPC\LAZARUS\fpc\2.2.4\source\rtl\os2>d:\fpc\lazarus\fpc\2.2.4\bin\i 386-win32\make d:/fpc/lazarus/fpc/2.2.4/bin/i386-win32/gmkdir.exe -p ../../rtl/units/i386-os2 i386-os2-as -o ../../rtl/units/i386-os2/prt0.o prt0.as process_begin: CreateProcess((null), i386-os2-as -o ../../rtl/units/i386-os2/prt 0.o prt0.as, ...) failed. make (e=2): The system cannot find the file specified. d:\fpc\lazarus\fpc\2.2.4\bin\i386-win32\make: *** [prt0.o] Error 2 Does anyone know where I could find answers to: What do I have to be concerned with - RTL, LCL, or more? What new directories and sets of files are needed? What are the step by step instructions to get what is needed? I would be so grateful to get pointed in the right direction. ---------------------------------------------------------------------- marcov · 2011-01-11 14:39 Quote from: march on January 11, 2011, 08:54:17 amI have just developed a Lazarus application in Windows XP. Now I must make a version for OS/2 (eCS). It should be one of the easier setups because of similarity with Windows and the same i386 processor. I have spent the last few days searching and looking over all the FAQs, documents and messages that I can find about cross-compiling. Many of these seem to be out of date, or deal only with Linux as host. There are so many conflicting details that I am confused and do not know what should apply to Lazarus 0.9.28.2 with Win32 host. There is an fpc\2.2.4\source\rtl\os2 directory which contains a Makefile. Should I be using this? I tried running make.exe No in principle you need to run "make all OS_TARGET=os2" globally, iow in fpc/ Quotehere, but got error messages right away: D:\FPC\LAZARUS\fpc\2.2.4\source\rtl\os2>d:\fpc\lazarus\fpc\2.2.4\bin\i 386-win32\make d:/fpc/lazarus/fpc/2.2.4/bin/i386-win32/gmkdir.exe -p ../../rtl/units/i386-os2 i386-os2-as -o ../../rtl/units/i386-os2/prt0.o prt0.as process_begin: CreateProcess((null), i386-os2-as -o ../../rtl/units/i386-os2/prt 0.o prt0.as, ...) failed. make (e=2): The system cannot find the file specified. d:\fpc\lazarus\fpc\2.2.4\bin\i386-win32\make: *** [prt0.o] Error 2 i386-os2-as are crossbinutils win32->os2.  We don't distribute crossbinutils by default, and you will have to create these (compiling binutils with the relevant options under mingw) yourself QuoteDoes anyone know where I could find answers to: What do I have to be concerned with - RTL, LCL, or more? What new directories and sets of files are needed? What are the step by step instructions to get what is needed? I would be so grateful to get pointed in the right direction. Anyway, only FPC supports OS/2, Lazarus not. ---------------------------------------------------------------------- march · 2011-01-12 06:16 Thanks marcov, I found a binutils file called "binutils-2.6-win32-i386-os2.zip" with   i386-os2-ar.exe   i386-os2-as.exe   i386-os2-as_2_6.exe   i386-os2-emxbind.exe   i386-os2-ld.exe   i386-os2-objdump.exe   i386-os2-strip.exe It looks like an assembler, linker and a few other things, but they are old (1998). I wonder if they are still good for FPC 2.2.4? Anyhow, I will put them in the win32 bin directory and try your suggestion to "make all" in fpc/. Quote from: marcov on January 11, 2011, 03:39:38 pmAnyway, only FPC supports OS/2, Lazarus not. When I started this project, I saw that os2 was listed as a target OS under Compiler Options - Code, and got my hopes up about porting my Lazarus application. But now I realize that there are a lot of complications and it may not be possible.