I build FPC cross-compilers for Windows, Macintosh and (32 bit) Linux on a Debian Wheezy 64 bit host.<br><br>There appears to be a bug in the build process that produces dodgy <i>crosszipinstall tarballs</i> for Windows.<br>
<br>This applies to FPC 2.6.0, 2.6.2 RC1 and 2.7.1 (today's SVN head). It's completely broken in 2.7.1 so I'll ignore that.<br><br>Below is the <b>build script</b> and the (filtered) <b>directory layout</b> of each tarball produced when building 2.6.2 RC 1.<br>
<br><b>fpc-2.6.2rc1.x86_64-linux.tar.gz</b> is the native compiler. All the others are all cross-compilers.<br><br>Both windows compilers have directory structures that are different and seem to be wrong.<br><br>They do not appear to map where <b>fpc</b> expects to find <b>ppcross386</b> and <b>ppcrossx64</b> compilers (i.e. <i>lib/fpc/2.6.2</i>) and instead they are located in <i><b>bin/<arch>/</b></i>. Further, the tarball cannot simply be unpacked at the installation root (e.g. /usr/local) to have everything put in the correct place.<br>
<br>I can manually work around this problem but am I missing something? <br><br>Is this installation difference intentional?<br><br>Is there some additional option required when building cross compilers for Windows?<br><br>
Many thanks, Cheers, Bruce.<b></b><br><pre><span class="comment-delimiter"><b>Build Script...</b><br><br># </span><span class="comment">Build Mac OSX 10.6 64 Bit...
</span>make distclean >/dev/null
<span class="keyword">time</span> make crossall crosszipinstall <span class="sh-escaped-newline">\</span>
<span class="variable-name">CPU_TARGET</span>=x86_64 <span class="variable-name">OS_TARGET</span>=darwin <span class="sh-escaped-newline">\</span>
<span class="variable-name">CROSSBINDIR</span>=/usr/local/opt/cctools/bin <span class="sh-escaped-newline">\</span>
<span class="variable-name">BINUTILSPREFIX</span>=i686-darwin- <span class="sh-escaped-newline">\</span>
<span class="variable-name">OPT</span>=<span class="string">"-gl -gw -godwarfsets -XX -CX -Xd -Fl${OSX_SDK_LIB}"</span>

<span class="comment-delimiter"># </span><span class="comment">Build Mac OSX 10.6 32 Bit...
</span>make distclean >/dev/null
<span class="keyword">time</span> make crossall crosszipinstall <span class="sh-escaped-newline">\</span>
<span class="variable-name">CPU_TARGET</span>=i386 <span class="variable-name">OS_TARGET</span>=darwin <span class="sh-escaped-newline">\</span>
<span class="variable-name">CROSSBINDIR</span>=/usr/local/opt/cctools/bin <span class="sh-escaped-newline">\</span>
<span class="variable-name">BINUTILSPREFIX</span>=i686-darwin- <span class="sh-escaped-newline">\</span>
<span class="variable-name">OPT</span>=<span class="string">"-gl -gw -godwarfsets -XX -CX -Xd -Fl${OSX_SDK_LIB}"</span>

<span class="comment-delimiter"># </span><span class="comment">Build Windows 8 64 Bit...
</span>make distclean >/dev/null
<span class="keyword">time</span> make crossall crosszipinstall <span class="sh-escaped-newline">\</span>
<span class="variable-name">CPU_TARGET</span>=x86_64 <span class="variable-name">OS_TARGET</span>=win64 <span class="sh-escaped-newline">\</span>
<span class="variable-name">CROSSBINDIR</span>=/usr/local/opt/binutils/bin <span class="sh-escaped-newline">\</span>
<span class="variable-name">BINUTILSPREFIX</span>=i386-mingw- <span class="sh-escaped-newline">\</span>
<span class="variable-name">OPT</span>=<span class="string">"-XX -CX"</span>

<span class="comment-delimiter"># </span><span class="comment">Build Windows 8 32 Bit...
</span>make distclean >/dev/null
<span class="keyword">time</span> make crossall crosszipinstall <span class="sh-escaped-newline">\</span>
<span class="variable-name">CPU_TARGET</span>=i386 <span class="variable-name">OS_TARGET</span>=win32 <span class="sh-escaped-newline">\</span>
<span class="variable-name">CROSSBINDIR</span>=/usr/local/opt/binutils/bin <span class="sh-escaped-newline">\</span>
<span class="variable-name">BINUTILSPREFIX</span>=i386-mingw- <span class="sh-escaped-newline">\</span>
<span class="variable-name">OPT</span>=<span class="string">"-XX -CX"</span>

<span class="comment-delimiter"># </span><span class="comment">Build Linux 32 Bit...
</span>make distclean >/dev/null
<span class="keyword">time</span> make crossall crosszipinstall <span class="sh-escaped-newline">\</span>
<span class="variable-name">CPU_TARGET</span>=i386 <span class="variable-name">OS_TARGET</span>=linux <span class="sh-escaped-newline">\</span>
<span class="variable-name">CROSSBINDIR</span>=/usr/local/opt/binutils/bin <span class="sh-escaped-newline">\</span>
<span class="variable-name">BINUTILSPREFIX</span>=i386-linux- <span class="sh-escaped-newline">\</span>
<span class="variable-name">OPT</span>=<span class="string">"-XX -CX"</span>

<span class="comment-delimiter"># </span><span class="comment">Build (native) Linux 64 Bit...
</span>make distclean >/dev/null
<span class="keyword">time</span> make all zipinstall<br><br><b>Directory Layout...</b><br></pre><pre><span class="comint-highlight-prompt">bruce@beria:~/hg/pascal$ </span><span class="comint-highlight-input">tar tvfz fpc-2.6.2rc1.i386-win32.tar.gz # cross compiler (wrong layout?)</span>
drwxr-xr-x bruce/bruce       0 2013-01-07 16:03 bin/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:03 bin/x86_64-linux/
-rwxr-xr-x bruce/bruce 2760664 2013-01-07 16:03 bin/x86_64-linux/ppcross386
drwxr-xr-x bruce/bruce       0 2013-01-07 16:03 units/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:03 units/i386-win32/
<span class="comint-highlight-prompt">bruce@beria:~/hg/pascal$ </span><span class="comint-highlight-input">tar tvfz fpc-2.6.2rc1.i386-darwin.tar.gz # cross compiler (correct layout)</span>
drwxr-xr-x bruce/bruce       0 2013-01-07 16:00 bin/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:00 lib/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:00 lib/fpc/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:00 lib/fpc/2.6.2/
-rwxr-xr-x bruce/bruce 8376619 2013-01-07 16:00 lib/fpc/2.6.2/ppcross386
drwxr-xr-x bruce/bruce       0 2013-01-07 16:00 lib/fpc/2.6.2/units/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:00 lib/fpc/2.6.2/units/i386-darwin/
<span class="comint-highlight-prompt">bruce@beria:~/hg/pascal$ </span><span class="comint-highlight-input">tar tvfz fpc-2.6.2rc1.i386-linux.tar.gz # cross compiler (correct layout)</span>
drwxr-xr-x bruce/bruce       0 2013-01-07 16:04 bin/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:04 lib/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:04 lib/fpc/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:04 lib/fpc/2.6.2/
-rwxr-xr-x bruce/bruce 2760664 2013-01-07 16:04 lib/fpc/2.6.2/ppcross386
drwxr-xr-x bruce/bruce       0 2013-01-07 16:04 lib/fpc/2.6.2/units/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:04 lib/fpc/2.6.2/units/i386-linux/
<span class="comint-highlight-prompt">bruce@beria:~/hg/pascal$ </span><span class="comint-highlight-input">tar tvfz fpc-2.6.2rc1.x86_64-win64.tar.gz # cross compiler (wrong layout?)</span>
drwxr-xr-x bruce/bruce       0 2013-01-07 16:01 bin/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:01 bin/x86_64-linux/
-rwxr-xr-x bruce/bruce 2471768 2013-01-07 16:01 bin/x86_64-linux/ppcrossx64
drwxr-xr-x bruce/bruce       0 2013-01-07 16:01 units/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:01 units/x86_64-win64/
<span class="comint-highlight-prompt">bruce@beria:~/hg/pascal$ </span><span class="comint-highlight-input">tar tvfz fpc-2.6.2rc1.x86_64-darwin.tar.gz # cross compiler (correct layout)</span>
drwxr-xr-x bruce/bruce       0 2013-01-07 15:58 bin/
drwxr-xr-x bruce/bruce       0 2013-01-07 15:58 lib/
drwxr-xr-x bruce/bruce       0 2013-01-07 15:58 lib/fpc/
drwxr-xr-x bruce/bruce       0 2013-01-07 15:58 lib/fpc/2.6.2/
drwxr-xr-x bruce/bruce       0 2013-01-07 15:58 lib/fpc/2.6.2/units/
drwxr-xr-x bruce/bruce       0 2013-01-07 15:58 lib/fpc/2.6.2/units/x86_64-darwin/
-rwxr-xr-x bruce/bruce 7773587 2013-01-07 15:58 lib/fpc/2.6.2/ppcrossx64
<span class="comint-highlight-prompt">bruce@beria:~/hg/pascal$ </span><span class="comint-highlight-input">tar tvfz fpc-2.6.2rc1.x86_64-linux.tar.gz # native installation (correct layout)</span>
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 bin/
-rwxr-xr-x bruce/bruce  371304 2013-01-07 16:06 bin/fpc
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 lib/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 lib/fpc/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 lib/fpc/2.6.2/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 lib/fpc/2.6.2/units/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 lib/fpc/2.6.2/units/x86_64-linux/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 lib/fpc/2.6.2/ide/
-rwxr-xr-x bruce/bruce 2868120 2013-01-07 16:06 lib/fpc/2.6.2/ppcx64
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 lib/fpc/2.6.2/msg/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 lib/fpc/lexyacc/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 share/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 share/doc/
drwxr-xr-x bruce/bruce       0 2013-01-07 16:06 share/doc/fpc-2.6.2/
<span class="string"><span class="comint-highlight-prompt">bruce@beria:~/hg/pascal$ </span></span></pre>