On 05/14/2012 09:00 PM, Maarten Boekhold wrote:
However, I can't get it to link statically to all libraries, the way that the official binary distribution seems to do.
Hi all,
Again I seem to have made some wrong assumptions. After closer inspection, it seems that the windows x2goclient isn't fully statically linked. It seems that only the Qt libraries have been linked against statically. I believe that was probably done by doing a manual build of Qt using "configure -static" (note that I've never compiled Qt myself from source, so I'm just copying this blindly from the "Deploying an Application on Windows" page in the Qt 4.8 documentation on the qt-project.org web site). Since I just use the downloaded Qt distribution for MinGW, I probably can't reproduce this without compiling a static version of Qt myself.
Apart from the static linking of Qt libraries, I think I have now more or less created a usable build of the x2goclient, using the instructions below (enhanced from what I posted before).
I'll now try to add HTTP proxy support (using corkscrew) into this.
Maarten
Download MingW installer from: https://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/
get the latest mingw-get-inst-*.exe file
Run the installer, install in C:\sw\MinGW after installation, run C:\sw\MinGW\msys\1.0\msys.bat (or open the shortcuts in your start menu/desktop if you installed any)
cd /c/sw/MinGW/msys/1.0/postinstall
sh ./pi.sh
Create c:\home On My Computer->Properties->Advanced->Environment Variables, set HOME=c:\home
Create C:\home\.profile
PATH=$PATH:/c/sw/Qt/4.8.1/bin
export PATH
Download QT from: http://releases.qt-project.org/qt4/source/qt-win-opensource-4.8.1-mingw.exe install in c:\sw\Qt Make sure to point to the MinGW installation used above.
Download libssh and libz from: http://winkde.org/pub/kde/ports/win32/repository-4.8/win32libs/libssh-x86-mi... http://winkde.org/pub/kde/ports/win32/repository-4.8/win32libs/libssh-x86-mi... http://winkde.org/pub/kde/ports/win32/repository-4.8/win32libs/zlib-x86-ming... http://winkde.org/pub/kde/ports/win32/repository-4.8/win32libs/zlib-x86-ming...
(libssh seems to be very hard to compile on mingw. Its build-system is based on CMake, which I don't think is available on mingw. The KDE people have done the hard work however, so we use their results)
cd /usr/local tar zxf .../path/to/libssh-x86-mingw4-0.5.2-1-bin.tar.bz2 tar zxf .../path/to/libssh-x86-mingw4-0.5.2-1-lib.tar.bz2 tar zxf .../path/to/zlib-x86-mingw4-1.2.5-1-bin.tar.bz2 tar zxf .../path/to/zlib-x86-mingw4-1.2.5-1-lib.tar.bz2
Build a custom version of openssl ("mingw-get install msys-openssl" doesn't seem to install a compatible version, as static linking doesn't work with that one).
Download OpenSSL from: http://www.openssl.org/source/openssl-1.0.1c.tar.gz
cd ~ tar zxf /path/to/openssl-1.0.1c.tar.gz cd openssl-1.0.1c ./configure mingw --prefix=/usr/local make make install (make install takes a long time, it installs like 10K man pages, somebody could probably find out how to install this without man pages in order to speed this up)
Download x2goclient source code from: http://code.x2go.org/releases/source/x2goclient/x2goclient_3.99.2.0.tar.gz
cd ~ tar zxf /path/to/x2goclient_3.99.2.0.tar.gz cd x2goclient_3.99.2.0 Edit x2goclient.pro file Replace the part that says:
win32-* {
message(building $$TARGET for windows without ldap and cups)
LIBS += -lwinspool -lws2_32
CONFIG += static release
}
with:
win32-* {
message(building $$TARGET for windows without ldap and cups)
INCLUDEPATH += /usr/local/include
LIBPATH += /usr/local/lib
LIBS += -lssl -lcrypto -lwinspool -lws2_32
CONFIG += static release
QMAKE_LFLAGS += -static-libstdc++
}
make build_client
Create a new distribution directory C:\myx2goclient Copy into this directory: