See http://unetbootin.wiki.sourceforge.net/compile for build instructions

Building a Dynamically Linked Version

Dynamically linked builds are most useful for packaging into Linux distributions. If you are attempting to standalone version for deployment on Windows, go to the statically linked section.

Prerequisites

Latest "clean" tarball at http://unetbootin.sourceforge.net/unetbootin-source-clean-latest.tar.gz
libqt4-dev
g++

Instructions

1. Extract the tarball and cd to it

2. Run either the "INSTALL" script, or the following commands:

sed -i '/^RESOURCES/d' unetbootin.pro
lupdate unetbootin.pro
lrelease unetbootin.pro
qmake "DEFINES += NOSTATIC" "RESOURCES -= unetbootin.qrc"
make


3. A dynamically linked executable which you can package will then be generated at "unetbootin"

4. If building a package, place the unetbootin_*.qm files in the /usr/share/unetbootin/ directory to enable the usage of localization.

5. If building a package, add "syslinux", "p7zip-full", "libqt4-core" (libQtCore.so.4), "libqt4-gui" (libQtGui.so.4), and "libqt4-network" (libQtNetwork.so.4) as dependencies.

Building a Statically Linked Version

Statically linked builds are most useful for standalone deployment, not packaging. They are the type that is available for download on the website.

Build System

I build on Ubuntu with g++ and mingw32, though it should work on other distributions as well.

Prerequisites

Latest source zip package at http://unetbootin.sourceforge.net/unetbootin-source-latest.zip
libqt4-dev
mingw32
g++

Instructions (Simple)

These instructions use pre-compiled versions of static Qt4 for Windows and Linux. If you'd like to build statically linked versions of Qt4 yourself, use the manual instructions instead.

1. Go to http://launchpad.net/unetbootin/+download and download these files:

qt4-win.7z http://launchpad.net/unetbootin/trunk/trunk/+download/qt4-win.7z

qt4-x11-glibc23.7z http://launchpad.net/unetbootin/trunk/trunk/+download/qt4-x11-glibc23.7z

Or if you can handle a GLIBC 2.4 dependency:

qt4-x11.7z http://launchpad.net/unetbootin/trunk/trunk/+download/qt4-x11.7z

2. Extract those files using 7-zip http://www.7-zip.org/ or p7zip-full on Linux, to get the directories "qt4-win" and "qt4-x11"

3. Move the qt4-win and qt4-x11 directories into the UNetbootin build directory (the same directory containing the files unetbootin.cpp and unetbootin.pro, which is src/unetbootin in the bzr branch).

4. cd to the UNetbootin build directory, and run the script "./build"

5. Statically linked UNetbootin binaries should be generated in the release subdirectory.

Instructions (Manual)

1) Build a statically linked Qt4 for Windows (instructions from http://doc.trolltech.com/4.3/deployment-windows.html#static-linking and http://qtnode.net/wiki?title=Building_static )

cd C:\Qt4
configure -static
make sub-src

2) Set up cross-compile environment (instructions from http://gentoo-wiki.com/HOWTO_MinGW_and_Qt4 )

If cross-compiling on Ubuntu, simply copy the file qmake.conf to /usr/share/qt4/mkspecs/win32-g++/qmake.conf

3) Copy over your statically linked Windows qt4 install directory to /usr/i586-mingw32msvc/Qt/

4) Go to the directory containing the source files (unetbootin.cpp, main.cpp, unetbootin.pro, etc.), and run "./build" to automate steps 4 and 5, or to do it manually, run the following commands:

qmake -spec win32-g++ "RESOURCES += unetbootin-windows.qrc" "RC_FILE += ubnembed.rc" "QMAKE_LFLAGS += -Wl,-subsystem,windows"

make

5) You should now have a Windows .exe file at release/unetbootin.exe

To reduce file size, compress the executable using upx ( http://upx.sourceforge.net/ )

./upx --lzma ./unetbootin.exe

