Cross compiling FileZilla on Linux for Windows

Need help with FileZilla Client? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Message
Author
winzilla
450 Internal Error
Posts: 36
Joined: 2023-01-14 19:31

Cross compiling FileZilla on Linux for Windows

#1 Post by winzilla » 2023-01-14 19:41

I have been trying to crosscompile FileZilla for Windows using the instructions here: https://wiki.filezilla-project.org/Cros ... _GNU/Linux

There were a couple basic outdated things on the wiki that I had to change, for example:
svn co https://svn.filezilla-project.org/svn/F ... gs/3.56.0/ fz
to
svn co https://svn.filezilla-project.org/svn/FileZilla3/trunk fz

I also had to change:
wine "$HOME/.wine/drive_c/Program Files/NSIS/makensis.exe" install.nsi
to
wine "$HOME/.wine/drive_c/Program Files (x86)/NSIS/makensis.exe" install.nsi

Some other things failed to build, namely GMP, due to a bunch of cryptic linking issues (mostly mingw related stuff, it seemed).

I noticed the top-level compiling wiki page says you can also install packages: apt-get -y install libfilezilla-dev libwxbase3.0-dev gnutls-dev libdbus-1-dev

GMP was needed for libfilezilla, and so I tried using the package instead. Debian 11 has the 0.26 package, while FileZilla requires 0.34+, so I retried everything on Ubuntu instead since the packages there are more up to date.

I got further with that, since Ubuntu comes with libfilezilla-dev 0.36. However, eventually I end up getting to the same issues at the end, with running the very last command:

Code: Select all

wine "$HOME/.wine/drive_c/Program Files (x86)/NSIS/makensis.exe" install.nsi
First of all, there is install.nsi in the data folder, so this confuses me. There is an install.nsi.in, however. Is this the same file? Should I just change the arguments?

When doing it that way, I run into a bunch of issues with files that are missing that it expects. This is the first one:

Code: Select all

root@debian11:~/src/fz# makensis data/install.nsi.in
Processing config: /etc/nsisconf.nsh
Processing script file: "data/install.nsi.in" (UTF8)
!include: could not find: "libtoolexecutablesubdir.nsh"
Error in script "data/install.nsi.in" on line 49 -- aborting creation process
Some digging around in data/Makefile.in suggested I could try creating libtoolexecutablesubdir.nsh in the current directory and put this in it:

Code: Select all

!define LT_EXEDIR ".libs\\"
That took care of that, but then I get:

Code: Select all

root@ubuntu:~/src/fz/data# wine "$HOME/.wine/drive_c/Program Files (x86)/NSIS/makensis.exe" install.nsi.in
0050:err:explorer:initialize_display_settings Failed to query current display settings for L"\\\\.\\DISPLAY1".
Processing config: C:\Program Files (x86)\NSIS\nsisconf.nsh
Processing script file: "install.nsi.in" (ACP)
!include: could not find: "@srcdir@\process_running.nsh"
Error in script "install.nsi.in" on line 67 -- aborting creation process
Except for this one, I can't find any references to "process_running.nsh" that suggest what the file should contain.

Anyone know what I could be doing wrong here? Looking at the files referenced in install.nsi.in, none of them seem to exist, and I'm not sure how they get created.

User avatar
botg
Site Admin
Posts: 35507
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Cross compiling FileZilla on Linux for Windows

#2 Post by botg » 2023-01-14 22:45

Looks like you never ran the configure script to completion.

winzilla
450 Internal Error
Posts: 36
Joined: 2023-01-14 19:31

Re: Cross compiling FileZilla on Linux for Windows

#3 Post by winzilla » 2023-01-15 00:47

Ah, thanks for the catch.

Surprisingly, the requirements are higher on Ubuntu, now it wants >= 0.39.4 rather than >= 0.34 as on Debian 11. The package libfilezilla-dev installed 0.36.

I can compile from source successfully, so I uninstalled the package, and now it doesn't find it at all:
configure: error: libfilezilla not found: No package 'libfilezilla' found. You can download it from https://lib.filezilla-project.org/

Here's what I ran to install libfilezilla:

Code: Select all

svn co https://svn.filezilla-project.org/svn/libfilezilla/trunk lfz
cd lfz
autoreconf -i
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static
make
make install
This succeeded with no errors. Here's the tail end of the output:

Code: Select all

Libraries have been installed in:
   /root/prefix/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /usr/bin/mkdir -p '/root/prefix/include'
 /usr/bin/mkdir -p '/root/prefix/include/libfilezilla'
 /usr/bin/install -c -m 644  libfilezilla/ascii_layer.hpp libfilezilla/apply.hpp libfilezilla/buffer.hpp libfilezilla/encode.hpp libfilezilla/encryption.hpp libfilezilla/event.hpp libfilezilla/event_handler.hpp libfilezilla/event_loop.hpp libfilezilla/file.hpp libfilezilla/format.hpp libfilezilla/fsresult.hpp libfilezilla/hash.hpp libfilezilla/hostname_lookup.hpp libfilezilla/impersonation.hpp libfilezilla/invoker.hpp libfilezilla/iputils.hpp libfilezilla/json.hpp libfilezilla/jws.hpp libfilezilla/libfilezilla.hpp libfilezilla/local_filesys.hpp libfilezilla/logger.hpp libfilezilla/mutex.hpp libfilezilla/nonowning_buffer.hpp libfilezilla/optional.hpp libfilezilla/process.hpp libfilezilla/rate_limiter.hpp libfilezilla/rate_limited_layer.hpp libfilezilla/recursive_remove.hpp libfilezilla/rwmutex.hpp libfilezilla/shared.hpp libfilezilla/signature.hpp libfilezilla/socket.hpp libfilezilla/string.hpp libfilezilla/thread.hpp libfilezilla/thread_pool.hpp libfilezilla/time.hpp libfilezilla/tls_info.hpp libfilezilla/tls_layer.hpp libfilezilla/tls_system_trust_store.hpp libfilezilla/translate.hpp '/root/prefix/include/libfilezilla'
 /usr/bin/mkdir -p '/root/prefix/include/libfilezilla/aio'
 /usr/bin/install -c -m 644  libfilezilla/aio/aio.hpp libfilezilla/aio/reader.hpp libfilezilla/aio/writer.hpp libfilezilla/aio/xml_writer.hpp '/root/prefix/include/libfilezilla/aio'
 /usr/bin/mkdir -p '/root/prefix/include/libfilezilla'
 /usr/bin/install -c -m 644  libfilezilla/uri.hpp libfilezilla/util.hpp libfilezilla/visibility_helper.hpp libfilezilla/xml.hpp '/root/prefix/include/libfilezilla'
 /usr/bin/mkdir -p '/root/prefix/include/libfilezilla/private'
 /usr/bin/install -c -m 644  libfilezilla/private/defs.hpp libfilezilla/private/visibility.hpp '/root/prefix/include/libfilezilla/private'
 /usr/bin/mkdir -p '/root/prefix/include/libfilezilla/glue'
 /usr/bin/install -c -m 644  libfilezilla/glue/wx.hpp libfilezilla/glue/wxinvoker.hpp libfilezilla/glue/unix.hpp '/root/prefix/include/libfilezilla/glue'
 /usr/bin/mkdir -p '/root/prefix/include'
 /usr/bin/mkdir -p '/root/prefix/include/libfilezilla'
 /usr/bin/install -c -m 644  libfilezilla/version.hpp '/root/prefix/include/libfilezilla'
 /usr/bin/mkdir -p '/root/prefix/lib/pkgconfig'
 /usr/bin/install -c -m 644 libfilezilla.pc '/root/prefix/lib/pkgconfig'
make[2]: Leaving directory '/root/src/lfz/lib'
make[1]: Leaving directory '/root/src/lfz/lib'
Making install in demos
make[1]: Entering directory '/root/src/lfz/demos'
make[2]: Entering directory '/root/src/lfz/demos'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/root/src/lfz/demos'
make[1]: Leaving directory '/root/src/lfz/demos'
Making install in locales
make[1]: Entering directory '/root/src/lfz/locales'
make[2]: Entering directory '/root/src/lfz/locales'
make[2]: Nothing to be done for 'install-exec-am'.
for i in an ar az bg_BG ca ca_ES@valencia co cs_CZ cy da de el es et eu fa_IR fi_FI fr gl_ES he_IL hr hu_HU hy id_ID is it ja_JP kab ko_KR ky lo_LA lt_LT lv_LV mk_MK nb_NO ne nl nn_NO oc pl_PL pt_BR pt_PT ro_RO ru sk_SK sl_SI sr sv th_TH tr uk_UA vi_VN zh_CN zh_TW ; do \
  /bin/bash /root/src/lfz/config/install-sh -d /root/prefix/share/locale/$i/LC_MESSAGES ; \
  /usr/bin/install -c -m 644 $i.mo /root/prefix/share/locale/$i/LC_MESSAGES/libfilezilla.mo ; \
done
make[2]: Leaving directory '/root/src/lfz/locales'
make[1]: Leaving directory '/root/src/lfz/locales'
Making install in doc
make[1]: Entering directory '/root/src/lfz/doc'
make[2]: Entering directory '/root/src/lfz/doc'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/root/src/lfz/doc'
make[1]: Leaving directory '/root/src/lfz/doc'
But with the filezilla configure, I get:

Code: Select all

checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libfilezilla >= 0.39.2... no
configure: error: libfilezilla not found: No package 'libfilezilla' found. You can download it from https://lib.filezilla-project.org/
**2 hours later**: Okay, I forget what I did, but I was able to satisfy that somehow.
Next thing I've gotten stuck on is the filezilla configure scripts fails with:

```
checking positional printf argument support in wxWidgets... yes
checking GUI support in wxWidgets... no
configure: error: in `/root/src/fz':
configure: error: GUI support in wxWidgets is required by FileZilla. Please rebuild wxWidgets and pass --enable-gui to its configure script.
See `config.log' for more details
```

The widgets configure didn't have --enable-gui, so I added it and ran again.
configure succeeds, but compilation fails with stuff like this:

Code: Select all

/usr/bin/ld: netdll_socket.o:socket.cpp:(.text$_ZN12wxObjectListD0Ev[_ZN12wxObjectListD0Ev]+0x27): undefined reference to `operator delete(void*, unsigned long long)'
/usr/bin/ld: netdll_socket.o:socket.cpp:(.text$_ZN13wxSocketStateD0Ev[_ZN13wxSocketStateD0Ev]+0x2b): undefined reference to `operator delete(void*, unsigned long long)'
/usr/bin/ld: netdll_socket.o:socket.cpp:(.text$_ZN13wxSocketEventD0Ev[_ZN13wxSocketEventD0Ev]+0x2b): undefined reference to `operator delete(void*, unsigned long long)'
/usr/bin/ld: netdll_socket.o:socket.cpp:(.text$_ZNK13wxSocketEvent5CloneEv[_ZNK13wxSocketEvent5CloneEv]+0x12): undefined reference to `operator new(unsigned long long)'
/usr/bin/ld: netdll_socket.o:socket.cpp:(.text$_ZNK13wxSocketEvent5CloneEv[_ZNK13wxSocketEvent5CloneEv]+0x59): undefined reference to `operator delete(void*, unsigned long long)'
/usr/bin/ld: netdll_socket.o:socket.cpp:(.text$_ZN14wxSocketModuleD0Ev[_ZN14wxSocketModuleD0Ev]+0x50): undefined reference to `operator delete(void*, unsigned long long)'
/usr/bin/ld: netdll_socket.o:socket.cpp:(.text$_ZN14wxSocketClientD0Ev[_ZN14wxSocketClientD0Ev]+0x27): undefined reference to `operator delete(void*, unsigned long long)'
/usr/bin/ld: netdll_socket.o:socket.cpp:(.text$_ZN16wxDatagramSocketD0Ev[_ZN16wxDatagramSocketD0Ev]+0x27): undefined reference to `operator delete(void*, unsigned long long)'
/usr/bin/ld: netdll_socket.o:socket.cpp:(.text$_ZN14wxSocketServerD0Ev[_ZN14wxSocketServerD0Ev]+0x27): undefined reference to `operator delete(void*, unsigned long long)'
/usr/bin/ld: netdll_url.o:url.cpp:(.text$_ZN11wxURLModuleD0Ev[_ZN11wxURLModuleD0Ev]+0x50): more undefined references to `operator delete(void*, unsigned long long)' follow
/usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.38 assertion fail ../../bfd/reloc.c:8580
netdll_fs_inet.o:fs_inet.cpp:(.pdata$_ZN8wxThread8OnDeleteEv+0x0): dangerous relocation: collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
(There was a lot more beforehand, clipped for brevity)

This is the same type of thing I had an issue with GTK on Debian, that caused me to give up and try Ubuntu (where GTK worked, but now this doesn't).
Adding -lstdc++ as was suggested in a few places didn't make any difference with that.

Curious if people are doing this successfully on Debian 11 / Ubuntu, and if they are doing anything differently than I have been here.

User avatar
botg
Site Admin
Posts: 35507
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Cross compiling FileZilla on Linux for Windows

#4 Post by botg » 2023-01-15 18:47

Did you at some point restart your shell? If so, you need to once again set the environment variables. You also need to start over now, delete the installation prefix to get rid of all the bad stuff.

Also, don't ever compile programs as root. Such reckless use of root is a surefire way to eventually kill your operating system.

winzilla
450 Internal Error
Posts: 36
Joined: 2023-01-14 19:31

Re: Cross compiling FileZilla on Linux for Windows

#5 Post by winzilla » 2023-01-15 20:21

I know it's not a best practice (okay, a worst practice), but this is a machine I was using for this purpose, so I don't really care if it gets messed up, I have different VMs for each project.

I added set -e to the script so that it would abort on failure, since there seemed to be quite a few initially.

I had a hiccup with GnuTLS but was able to get that going after trying it again.

After wxWidgets make install, this doesn't work:

cp $HOME/prefix/lib/wx*.dll $HOME/prefix/bin

There aren't any dll files that get produced. However, it appears the libs are actually .so files, not .lib's, and they are present in the bin directory, so I guess I shouldn't be worried about this?

viewtopic.php?style=246&t=42578 had the right answer for not detecting libfilezilla previously.

With that, I get all the way to fz at the end:

Code: Select all

checking for libfilezilla >= 0.39.2... yes
checking for wx-config... /usr/bin/wx-config
checking for wxWidgets version >= 3.0.4 (--unicode=yes --universal=no)... yes (version 3.0.5)
checking for wxWidgets static library... no
checking positional printf argument support in wxWidgets... yes
checking GUI support in wxWidgets... no
configure: error: in `/root/src/fz':
configure: error: GUI support in wxWidgets is required by FileZilla. Please rebuild wxWidgets and pass --enable-gui to its configure script.
See `config.log' for more details
I did this all in one shot, and though it went more smoothly than previous runs, I can't quite seem to get past this one...

I did build wxWidgets with --enable-gui, by the way. Here's how I installed it:

Code: Select all

cd ~/src
git clone --branch WX_3_0_BRANCH --single-branch https://github.com/wxWidgets/wxWidgets.git wx3
cd wx3
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --enable-gui
make
make install
cp $HOME/prefix/lib/wx*.dll $HOME/prefix/bin
So maybe this is related to the dlls after all? Or might I be missing another environment variable?
Thanks!

User avatar
botg
Site Admin
Posts: 35507
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Cross compiling FileZilla on Linux for Windows

#6 Post by botg » 2023-01-15 22:06

Like I said, your environment variables aren't set, as result you are not even cross-compiling.

winzilla
450 Internal Error
Posts: 36
Joined: 2023-01-14 19:31

Re: Cross compiling FileZilla on Linux for Windows

#7 Post by winzilla » 2023-01-16 00:17

Okay, I made sure to set them in my shell as well as as in the script so if I manually have to take over then they're still there.

Do you know which this should be?

Code: Select all

./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --without-p11-kit --with-included-libtasn1 --with-included-unistring --enable-local-libopts --disable-srp-authentication --disable-dtls-srtp-support --disable-heartbeat-support --disable-psk-authentication --disable-anon-authentication --disable-openssl-compatibility --without-tpm --disable-cxx
is what's listed on the wiki.
However, with that, I get:

checking for getentropy... no
checking for NETTLE... yes
checking for HOGWEED... yes
checking for __gmpz_cmp in -lgmp... no
configure: error:
***
*** gmp was not found.

gmp is installed, so this isn't right.

Taking a cue from some of the other configures, if I do this, it gets past that part successfully:

Code: Select all

./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --without-p11-kit --with-included-libtasn1 --with-included-unistring --enable-local-libopts --disable-srp-authentication --disable-dtls-srtp-support --disable-heartbeat-support --disable-psk-authentication --disable-anon-authentication --disable-openssl-compatibility --without-tpm --disable-cxx LDFLAGS="-L$HOME/prefix/lib" CPPFLAGS="-I$HOME/prefix/include"
configure ends up succeeding, and I can actually start compiling. However, it then runs into a bunch of missing stuff that never showed up previously, I had to add all these:

Code: Select all

# Brotli
cd ~/src
git clone https://github.com/google/brotli.git
cd brotli
apt-get install cmake
mkdir out && cd out
../configure-cmake
make
make install
cp -r /usr/local/include/brotli/ $HOME/prefix/include

# zlib
apt-get install libz-dev
cp /usr/include/zstd.h $HOME/prefix/include

# idn2
wget -c ftp://alpha.gnu.org/gnu/libidn/libidn2-0.10.tar.gz
cd libidn2-0.10
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --enable-fat LDFLAGS="-L$HOME/prefix/lib" CPPFLAGS="-I$HOME/prefix/include"
make
make install
Even so, it still chokes on some idn2 stuff eventually:

Code: Select all

Making all in nettle
make[4]: Entering directory '/root/src/gnutls-3.7.8/lib/nettle'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/root/src/gnutls-3.7.8/lib/nettle'
make[4]: Entering directory '/root/src/gnutls-3.7.8/lib'
  CC       str-idna.lo
str-idna.c: In function 'gnutls_idna_map':
str-idna.c:64:15: warning: declaration of 'idn2_flags' shadows a global declaration [-Wshadow]
   64 |  unsigned int idn2_flags = IDN2_NFC_INPUT;
      |               ^~~~~~~~~~
In file included from str-idna.c:31:
/root/prefix/include/idn2.h:103:5: note: shadowed declaration is here
  103 |   } idn2_flags;
      |     ^~~~~~~~~~
str-idna.c:78:16: error: 'IDN2_NONTRANSITIONAL' undeclared (first use in this function)
   78 |  idn2_flags |= IDN2_NONTRANSITIONAL | IDN2_USE_STD3_ASCII_RULES;
      |                ^~~~~~~~~~~~~~~~~~~~
str-idna.c:78:16: note: each undeclared identifier is reported only once for each function it appears in
str-idna.c:78:39: error: 'IDN2_USE_STD3_ASCII_RULES' undeclared (first use in this function)
   78 |  idn2_flags |= IDN2_NONTRANSITIONAL | IDN2_USE_STD3_ASCII_RULES;
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~
str-idna.c:79:17: error: 'IDN2_TRANSITIONAL' undeclared (first use in this function)
   79 |  idn2_tflags |= IDN2_TRANSITIONAL | IDN2_USE_STD3_ASCII_RULES;
      |                 ^~~~~~~~~~~~~~~~~
str-idna.c:99:7: warning: implicit declaration of function 'idn2_to_ascii_8z' [-Wimplicit-function-declaration]
   99 |  rc = idn2_to_ascii_8z((ICAST*)istr.data, (ICAST**)&idna, idn2_flags);
      |       ^~~~~~~~~~~~~~~~
str-idna.c:99:7: warning: nested extern declaration of 'idn2_to_ascii_8z' [-Wnested-externs]
str-idna.c: In function 'gnutls_idna_reverse_map':
str-idna.c:166:7: warning: implicit declaration of function 'idn2_to_unicode_8z8z' [-Wimplicit-function-declaration]
  166 |  rc = idn2_to_unicode_8z8z((char*)istr.data, &u8, 0);
      |       ^~~~~~~~~~~~~~~~~~~~
str-idna.c:166:7: warning: nested extern declaration of 'idn2_to_unicode_8z8z' [-Wnested-externs]
make[4]: *** [Makefile:2805: str-idna.lo] Error 1
make[4]: Leaving directory '/root/src/gnutls-3.7.8/lib'
make[3]: *** [Makefile:2901: all-recursive] Error 1
make[3]: Leaving directory '/root/src/gnutls-3.7.8/lib'
make[2]: *** [Makefile:2505: all] Error 2
make[2]: Leaving directory '/root/src/gnutls-3.7.8/lib'
make[1]: *** [Makefile:2257: all-recursive] Error 1
make[1]: Leaving directory '/root/src/gnutls-3.7.8'
make: *** [Makefile:2182: all] Error 2
Are these extra things - brotli, zlib, idn2, etc. supposed to be getting pulled in? Want to make sure I'm not going into another wrong rabbit hole here...

User avatar
botg
Site Admin
Posts: 35507
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Cross compiling FileZilla on Linux for Windows

#8 Post by botg » 2023-01-16 07:42

If you're cross-compiling you need to cross-compile all missing dependencies, you cannot get them via apt. You especially cannot just blindly copy some header files, they typically contain platform-specific constants set at compile time for the host platform.

Please also post the complete configure output, snippets are of little use analyzing the problem.

winzilla
450 Internal Error
Posts: 36
Joined: 2023-01-14 19:31

Re: Cross compiling FileZilla on Linux for Windows

#9 Post by winzilla » 2023-01-16 15:03

Here's my current working script to try to cross compile things:

Code: Select all

#!/bin/sh

# https://svn.filezilla-project.org/filezilla/FileZilla3/
# https://wiki.filezilla-project.org/Cross_Compiling_FileZilla_3_for_Windows_under_Ubuntu_or_Debian_GNU/Linux

set -e

rm -rf ~/prefix
rm -rf ~/src

# These must be run as root
dpkg --add-architecture i386
apt update
apt install -y automake autoconf libtool make gettext lzip
apt install -y mingw-w64 pkg-config wx-common wine wine64 wine32 wine-binfmt subversion git

# libfilezilla-dev needs to be at least 0.34. Debian 11 gives you 0.26 from stable, Ubuntu gives you 0.36.
#apt-get -y install libfilezilla-dev libwxbase3.0-dev gnutls-dev libdbus-1-dev
#apt install -y libgtk2.0-dev libglib2.0-dev

# Everything else can be run as non-root, if desired.

mkdir ~/prefix
mkdir ~/src
export PATH="$HOME/prefix/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
export TARGET_HOST=x86_64-w64-mingw32

wine reg add HKCU\\Environment /f /v PATH /d "`x86_64-w64-mingw32-g++ -print-search-dirs | grep ^libraries | sed 's/^libraries: =//' | sed 's/:/;z:/g' | sed 's/^\\//z:\\\\\\\\/' | sed 's/\\//\\\\/g'`"

# GMP
cd ~/src
wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz
tar xf gmp-6.2.1.tar.lz
cd gmp-6.2.1
CC_FOR_BUILD=gcc ./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --disable-static --enable-shared --enable-fat
# This fails to build on Debian 11 for me, but it works on Ubuntu
make
make install

# Nettle
cd ~/src
wget https://ftp.gnu.org/gnu/nettle/nettle-3.7.3.tar.gz
tar xf nettle-3.7.3.tar.gz
cd nettle-3.7.3
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --enable-fat LDFLAGS="-L$HOME/prefix/lib" CPPFLAGS="-I$HOME/prefix/include"
make
make install

# Brotli
cd ~/src
git clone https://github.com/google/brotli.git
cd brotli
apt-get install cmake
mkdir out && cd out
../configure-cmake
make
make install
cp -r /usr/local/include/brotli/ $HOME/prefix/include

# zlib
#apt-get install libz-dev
#cp /usr/include/zstd.h $HOME/prefix/include

# idn2
cd ~/src
wget -c ftp://alpha.gnu.org/gnu/libidn/libidn2-0.10.tar.gz
tar -xvzf libidn2-0.10.tar.gz
cd libidn2-0.10
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --enable-fat LDFLAGS="-L$HOME/prefix/lib" CPPFLAGS="-I$HOME/prefix/include"
make
make install

# GnuTLS
cd ~/src
wget https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz
tar xvf gnutls-3.7.8.tar.xz
cd gnutls-3.7.8
#./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --without-p11-kit --with-included-libtasn1 --with-included-unistring --enable-local-libopts --disable-srp-authentication --disable-dtls-srtp-support --disable-heartbeat-support --disable-psk-authentication --disable-anon-authentication --disable-openssl-compatibility --without-tpm --disable-cxx
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --without-p11-kit --with-included-libtasn1 --with-included-unistring --enable-local-libopts --disable-srp-authentication --disable-dtls-srtp-support --disable-heartbeat-support --disable-psk-authentication --disable-anon-authentication --disable-openssl-compatibility --without-tpm --disable-cxx LDFLAGS="-L$HOME/prefix/lib" CPPFLAGS="-I$HOME/prefix/include"

make
make install

# SQLite
cd ~/src
#wget https://sqlite.org/2018/sqlite-autoconf-32600-00.tar.gz
#wget https://www.sqlite.com/matrix/2022/sqlite-autoconf-3390400.tar.gz # correct link, but server is down
wget https://github.com/elimuhubconsultant-co-ke/armbian_build/blob/master/sqlite-autoconf-3390300.tar.gz?raw=true
tar xvzf sqlite-autoconf-3390300.tar.gz?raw=true
cd sqlite-autoconf-3390300
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --disable-dynamic-extensions
make
make install

# NSIS
cd ~/src
wget https://prdownloads.sourceforge.net/nsis/nsis-3.04-setup.exe
wine nsis-3.04-setup.exe /S

[ -f "$HOME/.wine/drive_c/Program Files/NSIS/makensis.exe" ] && echo "Success!"

# wxWidgets
cd ~/src
git clone --branch WX_3_0_BRANCH --single-branch https://github.com/wxWidgets/wxWidgets.git wx3
cd wx3
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --enable-gui --enable-printfposparam
make
make install
cp $HOME/prefix/lib/wx*.dll $HOME/prefix/bin

# libfilezilla
cd ~/src
#svn co https://svn.filezilla-project.org/svn/libfilezilla/tags/0.33.0 lfz
svn co https://svn.filezilla-project.org/svn/libfilezilla/trunk lfz
cd lfz
autoreconf -i
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static
make
make install

# FileZilla
cd ~/src
#svn co https://svn.filezilla-project.org/svn/FileZilla3/tags/3.56.0/ fz
svn co https://svn.filezilla-project.org/svn/FileZilla3/trunk fz
cd fz

##

autoreconf -i
# https://forum.filezilla-project.org/viewtopic.php?style=246&t=42578
export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig/"
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --with-pugixml=builtin
make
# strip debug symbols
$TARGET_HOST-strip src/interface/.libs/filezilla.exe
$TARGET_HOST-strip src/putty/.libs/fzsftp.exe
$TARGET_HOST-strip src/putty/.libs/fzputtygen.exe
$TARGET_HOST-strip src/fzshellext/64/.libs/libfzshellext-0.dll
$TARGET_HOST-strip src/fzshellext/32/.libs/libfzshellext-0.dll
$TARGET_HOST-strip data/dlls/*.dll
cd data

# This is slightly modified from the original command on the website
# instead of apt install nsis, use wine:
wine "$HOME/.wine/drive_c/Program Files (x86)/NSIS/makensis.exe" install.nsi

# Voila, there's now FileZilla_3_setup.exe in the current directory.
I've attached a full log of running start to finish (well, where it gets stuck first) with tee.
Attachments
fzlog.txt
(1.08 MiB) Downloaded 42 times

User avatar
botg
Site Admin
Posts: 35507
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Cross compiling FileZilla on Linux for Windows

#10 Post by botg » 2023-01-16 16:39

Log seems to be missing the error output. Forgot 2>&1 ?

winzilla
450 Internal Error
Posts: 36
Joined: 2023-01-14 19:31

Re: Cross compiling FileZilla on Linux for Windows

#11 Post by winzilla » 2023-01-16 17:35

Whoops, yeah you're right. I did it again, it should be there now:
Attachments
fzlog.txt
(3.71 MiB) Downloaded 49 times

User avatar
botg
Site Admin
Posts: 35507
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Cross compiling FileZilla on Linux for Windows

#12 Post by botg » 2023-01-16 21:52

Weird, it seems to be picking up the native packages, which obviously are not suitable for cross-compilation.

Try configuring GnuTLS with these additional flags: --without-zlib --without-brotli --without-zstd --without-idn

Compression isn't used by FileZilla, and on Windows, libfilezilla handles IDN via the win32 API.

winzilla
450 Internal Error
Posts: 36
Joined: 2023-01-14 19:31

Re: Cross compiling FileZilla on Linux for Windows

#13 Post by winzilla » 2023-01-16 22:53

Ah, thanks! Now it seems to get further (with GnuTLS), but chokes when linking:
CCLD libgnutls.la

Full log attached again, and briefly the end:

Code: Select all

  CC       psk.lo
  CCLD     libgnutls.la
/usr/bin/x86_64-w64-mingw32-ld: .libs/kx.o: in function `_gnutls_nss_keylog_write':
/root/src/gnutls-3.7.8/lib/kx.c:158: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/kx.c:158: undefined reference to `__imp_pthread_once'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/kx.c:164: undefined reference to `__imp_pthread_mutex_lock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/kx.c:176: undefined reference to `__imp_pthread_mutex_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/priority.o: in function `_gnutls_update_system_priorities':
/root/src/gnutls-3.7.8/lib/priority.c:2175: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2175: undefined reference to `__imp_pthread_rwlock_rdlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2195: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2197: undefined reference to `__imp_pthread_rwlock_wrlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2280: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2280: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/priority.o: in function `_gnutls_resolve_priorities':
/root/src/gnutls-3.7.8/lib/priority.c:2343: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2396: undefined reference to `__imp_pthread_rwlock_rdlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2432: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/priority.o: in function `set_ciphersuite_list':
/root/src/gnutls-3.7.8/lib/priority.c:2511: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2511: undefined reference to `__imp_pthread_rwlock_rdlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2803: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:2803: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/priority.o: in function `gnutls_digest_set_secure':
/root/src/gnutls-3.7.8/lib/priority.c:3805: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3805: undefined reference to `__imp_pthread_rwlock_wrlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3807: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3821: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3811: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/priority.o: in function `gnutls_sign_set_secure':
/root/src/gnutls-3.7.8/lib/priority.c:3860: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3860: undefined reference to `__imp_pthread_rwlock_wrlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3862: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3882: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3875: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3866: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/priority.o: in function `gnutls_sign_set_secure_for_certs':
/root/src/gnutls-3.7.8/lib/priority.c:3924: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3924: undefined reference to `__imp_pthread_rwlock_wrlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3926: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3946: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3930: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3938: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/priority.o: in function `gnutls_protocol_set_enabled':
/root/src/gnutls-3.7.8/lib/priority.c:3981: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3981: undefined reference to `__imp_pthread_rwlock_wrlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3983: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3997: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:3987: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/priority.o: in function `gnutls_ecc_curve_set_enabled':
/root/src/gnutls-3.7.8/lib/priority.c:4032: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:4032: undefined reference to `__imp_pthread_rwlock_wrlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:4034: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:4048: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/priority.c:4038: undefined reference to `__imp_pthread_rwlock_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/global.o: in function `_gnutls_global_init':
/root/src/gnutls-3.7.8/lib/global.c:233: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/global.c:233: undefined reference to `__imp_pthread_mutex_lock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/global.c:381: undefined reference to `__imp_pthread_mutex_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/global.o: in function `_gnutls_global_deinit':
/root/src/gnutls-3.7.8/lib/global.c:389: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/global.c:441: undefined reference to `__imp_pthread_mutex_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/global.c:389: undefined reference to `__imp_pthread_mutex_lock'
/usr/bin/x86_64-w64-mingw32-ld: system/.libs/threads.o: in function `gnutls_system_mutex_init':
/root/src/gnutls-3.7.8/lib/system/threads.c:49: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/system/threads.c:49: undefined reference to `__imp_pthread_mutex_init'
/usr/bin/x86_64-w64-mingw32-ld: system/.libs/threads.o: in function `gnutls_system_mutex_deinit':
/root/src/gnutls-3.7.8/lib/system/threads.c:60: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/system/threads.c:60: undefined reference to `__imp_pthread_mutex_destroy'
/usr/bin/x86_64-w64-mingw32-ld: system/.libs/threads.o: in function `gnutls_system_mutex_lock':
/root/src/gnutls-3.7.8/lib/system/threads.c:69: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/system/threads.c:69: undefined reference to `__imp_pthread_mutex_lock'
/usr/bin/x86_64-w64-mingw32-ld: system/.libs/threads.o: in function `gnutls_system_mutex_unlock':
/root/src/gnutls-3.7.8/lib/system/threads.c:77: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/system/threads.c:77: undefined reference to `__imp_pthread_mutex_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/random.o: in function `_gnutls_rnd_init':
/root/src/gnutls-3.7.8/lib/random.c:82: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/random.c:82: undefined reference to `__imp_pthread_mutex_lock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/random.c:87: undefined reference to `__imp_pthread_mutex_unlock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/random.c:87: undefined reference to `__imp_pthread_mutex_unlock'
/usr/bin/x86_64-w64-mingw32-ld: .libs/verify-tofu.o: in function `store_pubkey':
/root/src/gnutls-3.7.8/lib/verify-tofu.c:407: undefined reference to `__imp_pthread_mutexattr_gettype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/verify-tofu.c:407: undefined reference to `__imp_pthread_mutex_lock'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/lib/verify-tofu.c:437: undefined reference to `__imp_pthread_mutex_unlock'
/usr/bin/x86_64-w64-mingw32-ld: ../gl/.libs/libgnu.a(lock.o): in function `glthread_recursive_lock_init_multithreaded':
/root/src/gnutls-3.7.8/gl/glthread/lock.c:538: undefined reference to `__imp_pthread_mutexattr_init'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/gl/glthread/lock.c:541: undefined reference to `__imp_pthread_mutexattr_settype'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/gl/glthread/lock.c:547: undefined reference to `__imp_pthread_mutex_init'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/gl/glthread/lock.c:553: undefined reference to `__imp_pthread_mutexattr_destroy'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/gl/glthread/lock.c:544: undefined reference to `__imp_pthread_mutexattr_destroy'
/usr/bin/x86_64-w64-mingw32-ld: /root/src/gnutls-3.7.8/gl/glthread/lock.c:550: undefined reference to `__imp_pthread_mutexattr_destroy'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:2644: libgnutls.la] Error 1
make[4]: Leaving directory '/root/src/gnutls-3.7.8/lib'
make[3]: *** [Makefile:2901: all-recursive] Error 1
make[3]: Leaving directory '/root/src/gnutls-3.7.8/lib'
make[2]: *** [Makefile:2505: all] Error 2
make[2]: Leaving directory '/root/src/gnutls-3.7.8/lib'
make[1]: *** [Makefile:2257: all-recursive] Error 1
make[1]: Leaving directory '/root/src/gnutls-3.7.8'
make: *** [Makefile:2182: all] Error 2
I know Windows doesn't have POSIX threads, so not really sure if it's supposed to have those in the first place or not.

And here's what I ran up to that point:

Code: Select all

set -e

rm -rf ~/prefix
rm -rf ~/src

# These must be run as root
dpkg --add-architecture i386
apt update
apt install -y automake autoconf libtool make gettext lzip
apt install -y mingw-w64 pkg-config wx-common wine wine64 wine32 wine-binfmt subversion git

# libfilezilla-dev needs to be at least 0.34. Debian 11 gives you 0.26 from stable, Ubuntu gives you 0.36.
#apt-get -y install libfilezilla-dev libwxbase3.0-dev gnutls-dev libdbus-1-dev
#apt install -y libgtk2.0-dev libglib2.0-dev

# Everything else can be run as non-root, if desired.

mkdir ~/prefix
mkdir ~/src
export PATH="$HOME/prefix/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
export TARGET_HOST=x86_64-w64-mingw32

wine reg add HKCU\\Environment /f /v PATH /d "`x86_64-w64-mingw32-g++ -print-search-dirs | grep ^libraries | sed 's/^libraries: =//' | sed 's/:/;z:/g' | sed 's/^\\//z:\\\\\\\\/' | sed 's/\\//\\\\/g'`"

# GMP
cd ~/src
wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz
tar xf gmp-6.2.1.tar.lz
cd gmp-6.2.1
CC_FOR_BUILD=gcc ./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --disable-static --enable-shared --enable-fat
# This fails to build on Debian 11 for me, but it works on Ubuntu
make
make install

# Nettle
cd ~/src
wget https://ftp.gnu.org/gnu/nettle/nettle-3.7.3.tar.gz
tar xf nettle-3.7.3.tar.gz
cd nettle-3.7.3
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --enable-fat LDFLAGS="-L$HOME/prefix/lib" CPPFLAGS="-I$HOME/prefix/include"
make
make install

# GnuTLS
cd ~/src
wget https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz
tar xvf gnutls-3.7.8.tar.xz
cd gnutls-3.7.8
#./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --without-p11-kit --with-included-libtasn1 --with-included-unistring --enable-local-libopts --disable-srp-authentication --disable-dtls-srtp-support --disable-heartbeat-support --disable-psk-authentication --disable-anon-authentication --disable-openssl-compatibility --without-tpm --disable-cxx
./configure --host=$TARGET_HOST --prefix="$HOME/prefix" --enable-shared --disable-static --without-p11-kit --with-included-libtasn1 --with-included-unistring --enable-local-libopts --disable-srp-authentication --disable-dtls-srtp-support --disable-heartbeat-support --disable-psk-authentication --disable-anon-authentication --disable-openssl-compatibility --without-tpm --without-zlib --without-brotli --without-zstd --without-idn --disable-cxx LDFLAGS="-L$HOME/prefix/lib" CPPFLAGS="-I$HOME/prefix/include"

make
make install
Attachments
fzlog.txt
(3.6 MiB) Downloaded 51 times

User avatar
botg
Site Admin
Posts: 35507
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Cross compiling FileZilla on Linux for Windows

#14 Post by botg » 2023-01-17 08:02

Very strange that it prefers the posix threads when cross-compiling for Windows, considering that pthreads on Windows is just a terribly slow wrapper around the Windows API. Try configuring with --enable-threads=windows

winzilla
450 Internal Error
Posts: 36
Joined: 2023-01-14 19:31

Re: Cross compiling FileZilla on Linux for Windows

#15 Post by winzilla » 2023-01-17 12:09

Okay, it gets further yet now - no idea why F_GETFD would be defined but F_GETFL wouldn't be, fcntl is clearly defined so maybe on Windows some things are missing?

Code: Select all

tlsproxy/crypto-gnutls.c: In function 'socksetnonblock':
tlsproxy/crypto-gnutls.c:113:23: error: 'F_GETFL' undeclared (first use in this function); did you mean 'F_GETFD'?
  113 |   int sf = fcntl (fd, F_GETFL, 0);
      |                       ^~~~~~~
      |                       F_GETFD
tlsproxy/crypto-gnutls.c:113:23: note: each undeclared identifier is reported only once for each function it appears in
tlsproxy/crypto-gnutls.c:116:21: error: 'F_SETFL' undeclared (first use in this function); did you mean 'F_GETFD'?
  116 |   return fcntl (fd, F_SETFL, nb ? (sf | O_NONBLOCK) : (sf & ~O_NONBLOCK));
      |                     ^~~~~~~
      |                     F_GETFD
tlsproxy/crypto-gnutls.c:117:1: warning: control reaches end of non-void function [-Wreturn-type]
  117 | }
      | ^
make[4]: *** [Makefile:2481: tlsproxy/crypto-gnutls.o] Error 1
make[4]: Leaving directory '/root/src/gnutls-3.7.8/doc/examples'
make[3]: *** [Makefile:4994: all-recursive] Error 1
make[3]: Leaving directory '/root/src/gnutls-3.7.8/doc'
make[2]: *** [Makefile:4665: all] Error 2
make[2]: Leaving directory '/root/src/gnutls-3.7.8/doc'
make[1]: *** [Makefile:2257: all-recursive] Error 1
make[1]: Leaving directory '/root/src/gnutls-3.7.8'
make: *** [Makefile:2182: all] Error 2
Attachments
fzlog.txt
(3.61 MiB) Downloaded 54 times

Post Reply