Difference between revisions of "Dev:Building on Windows"

From Synfig Studio :: Documentation
Jump to: navigation, search
m (put all the scripts inside boxes to make them a little easier to see)
(Files)
 
(29 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
<!--Categories-->
 +
{{Category|Building}}
 +
 
==Directories==
 
==Directories==
First, if you didn't already start an msys session, do so now. Just double click the MSYS shortcut or run <code>C:\msys\1.0\msys.bat</code>. An msys session will be opened, creating your profile directory at <code>C:\msys\1.0\home\<windows login></code>. As you can see, MinGW uses your windows login as the user name in its fake UNIX environment. Be careful, I've not checked whether it works with non latin-character account names.
+
If you didn't already install Mingw, {{l|Mingw installation|this page}} will guide you through the process.
  
Now, use explorer or your favorite file manager and go to <code>C:\msys\1.0\home\<windows login></code>. Create a directory there for all Synfig operations. For example, let it be <code>synfig</code>. Go into this directory.
+
If you didn't already start an msys session, do so now. Just double click the MSYS shortcut or run <code>'''C:\mingw\msys\1.0\msys.bat'''</code>. An msys session will be opened, creating your profile directory at <code>'''C:\mingw\msys\1.0\home\<windows login>'''</code>. As you can see, MinGW uses your windows login as the user name in its fake UNIX environment. Be careful, I've not checked whether it works with non latin-character account names.
  
Ok, now you are at <code>C:\msys\1.0\home\<windows login>\synfig</code>. Create four directories here:
+
Now, use explorer or your favorite file manager and go to <code>'''C:\mingw\msys\1.0\home\<windows login>'''</code>. Create a directory there for all Synfig operations. For example, let it be <code>'''synfig'''</code>. Go into this directory.
* <code>_filez</code>, for patches (and maybe later, additional files).
+
 
* <code>_src</code>, for program sources.
+
Ok, now you are at <code>'''C:\msys\1.0\home\<windows login>\synfig'''</code>. Create four directories here:
* <code>build</code>, for building programs.
+
* <code>'''_filez'''</code>, for patches (and maybe later, additional files).
* <code>temp</code>, for local installation programs and libraries, which are required for building synfig. (For example: ETL, synfig (core for studio), OpenEXR, etc...)
+
* <code>'''_src'''</code>, for program sources.
 +
* <code>'''build'''</code>, for building programs.
 +
* <code>'''temp'''</code>, for local installation programs and libraries, which are required for building synfig. (For example: ETL, synfig (core for studio), OpenEXR, etc...)
  
 
Of course, you can choose your own name for all the directories and choose their locations. All you need then is to set a new path in the configuration file. But for now we choose the easy way.
 
Of course, you can choose your own name for all the directories and choose their locations. All you need then is to set a new path in the configuration file. But for now we choose the easy way.
  
 
==Files==
 
==Files==
Save this configuration file as <code>C:\msys\1.0\home\<windows login>\synfig\synbuild.conf</code>:
+
Save this configuration file as <code>C:\mingw\msys\1.0\home\<windows login>\synfig\synbuild.conf</code>:
  
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
+
<code><pre><nowiki>
<pre># Synfig for Win32 build configuration script.
+
# Synfig for Win32 build configuration script.
#############################################################################
+
############################################################################
 
# 1. Files and Directories
 
# 1. Files and Directories
  
Line 33: Line 38:
  
 
# OpenEXR source package
 
# OpenEXR source package
SYN_OPENEXR_VERSION="1.4.0"
+
SYN_ILMBASE_VERSION="1.0.1"
SYN_OPENEXR_SRC="${SYN_SOURCE_DIR}/openexr-${SYN_OPENEXR_VERSION}a.tar.gz"
+
SYN_ILMBASE_SRC="${SYN_SOURCE_DIR}/ilmbase-${SYN_ILMBASE_VERSION}.tar.gz"
 +
SYN_OPENEXR_VERSION="1.6.1"
 +
SYN_OPENEXR_SRC="${SYN_SOURCE_DIR}/openexr-${SYN_OPENEXR_VERSION}.tar.gz"
  
 
#############################################################################
 
#############################################################################
Line 40: Line 47:
  
 
# Path to ImageMagick directory.
 
# Path to ImageMagick directory.
SYN_IMAGEMAGICK_PATH="C:\Program Files\ImageMagick"
+
SYN_IMAGEMAGICK_PATH="/C/Program Files/ImageMagick"
  
 
# Path to Subversion bin directory.
 
# Path to Subversion bin directory.
SYN_SUBVERSION_PATH="C:\Program Files\Subversion\bin"
+
SYN_SUBVERSION_PATH="/C/Program Files/Subversion/bin"
  
 
# Path to NSIS directory with makensis.exe file.
 
# Path to NSIS directory with makensis.exe file.
SYN_NSIS_PATH="C:\Program Files\NSIS"
+
SYN_NSIS_PATH="/C/Program Files/NSIS"
  
 
#############################################################################
 
#############################################################################
Line 58: Line 65:
  
 
# Make debug build of Synfig Studio
 
# Make debug build of Synfig Studio
SYN_STUDIO_DEBUG_BUILD="yes"
+
SYN_STUDIO_DEBUG_BUILD="no"
 +
#WITH_FMOD="yes"
  
 
#############################################################################
 
#############################################################################
Line 74: Line 82:
 
SYNSTUDIO_PATCHES=$(cat <<:END_SYNSTUDIO:
 
SYNSTUDIO_PATCHES=$(cat <<:END_SYNSTUDIO:
 
:END_SYNSTUDIO:)
 
:END_SYNSTUDIO:)
 +
 +
# OpenEXR ILMBase patches
 +
 +
ILMBASE_PATCHES=$(cat <<:END_ILMBASE:
 +
ilmbase-1.0.1-makefile.patch
 +
ilmbase-1.0.1-pkgconfig.patch
 +
:END_ILMBASE:)
  
 
# OpenEXR patches
 
# OpenEXR patches
 +
#openexr-1.4.0-pkgconfig.patch
 +
#openexr-1.4.0-mingw32.patch
 
OPENEXR_PATCHES=$(cat <<:END_OPENEXR:
 
OPENEXR_PATCHES=$(cat <<:END_OPENEXR:
openexr-1.4.0-pkgconfig.patch
 
openexr-1.4.0-mingw32.patch
 
 
:END_OPENEXR:)
 
:END_OPENEXR:)
  
Line 114: Line 129:
 
   PKG_CONFIG_PATH="${SYN_TEMP_INSTALL}/openexr/lib/pkgconfig:${PKG_CONFIG_PATH}"
 
   PKG_CONFIG_PATH="${SYN_TEMP_INSTALL}/openexr/lib/pkgconfig:${PKG_CONFIG_PATH}"
 
fi
 
fi
 +
 +
CPPFLAGS="-DSINGLE_THREADED $CPPFLAGS"
  
 
export PATH
 
export PATH
 
export PKG_CONFIG_PATH
 
export PKG_CONFIG_PATH
 
export CPPFLAGS
 
export CPPFLAGS
</pre></td></tr></table>
+
</nowiki></pre></code>
  
Save OpenEXR build script as <code>C:\msys\1.0\home\<windows login>\synfig\make_openexr.sh</code>:
+
Save OpenEXR build script as <code>C:\mingw\msys\1.0\home\<windows login>\synfig\make_openexr.sh</code>:
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
+
<code><pre><nowiki>
<pre>#!/bin/sh
+
#!/bin/sh
  
 
echo "Making OpenEXR..."
 
echo "Making OpenEXR..."
Line 136: Line 153:
  
 
echo "Cleanup directories"
 
echo "Cleanup directories"
rm -rf ${SYN_BUILD_DIR}/openexr
+
rm -rf ${SYN_BUILD_DIR}/ilmbase-${SYN_ILMBASE_VERSION}
 +
[ $? -eq 0 ] || exit 1
 +
rm -rf ${SYN_TEMP_INSTALL}/ilmbase
 +
[ $? -eq 0 ] || exit 1
 +
 
 +
rm -rf ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
 
rm -rf ${SYN_TEMP_INSTALL}/openexr
 
rm -rf ${SYN_TEMP_INSTALL}/openexr
Line 142: Line 164:
  
 
echo "Preparing sources"
 
echo "Preparing sources"
 +
echo PATH is $PATH
 +
echo tar -xzf ${SYN_ILMBASE_SRC} -C ${SYN_BUILD_DIR}
 +
tar -xzf ${SYN_ILMBASE_SRC} -C ${SYN_BUILD_DIR}
 +
[ $? -eq 0 ] || exit 1
 +
echo tar -xzf ${SYN_OPENEXR_SRC} -C ${SYN_BUILD_DIR}
 
tar -xzf ${SYN_OPENEXR_SRC} -C ${SYN_BUILD_DIR}
 
tar -xzf ${SYN_OPENEXR_SRC} -C ${SYN_BUILD_DIR}
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
  
echo "Applying patches..."
+
echo "Applying patches for ILMBase... "
 +
cd  ${SYN_BUILD_DIR}/ilmbase-${SYN_ILMBASE_VERSION}
 +
[ $? -eq 0 ] || exit 1
 +
for SFILE in ${ILMBASE_PATCHES[@]}
 +
do
 +
  patch -p1 <${SYN_FILEZ_DIR}/${SFILE}
 +
  [ $? -eq 0 ] || exit 1
 +
done
 +
 
 +
echo "Configuring ILMbase"
 +
[ $? -eq 0 ] || exit 1
 +
./configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=${SYN_TEMP_INSTALL}/openexr \
 +
  --disable-static --disable-threading --disable-posix-sem
 +
[ $? -eq 0 ] || exit 1
 +
 
 +
echo "Making"
 +
make
 +
[ $? -eq 0 ] || exit 1
 +
make install
 +
[ $? -eq 0 ] || exit 1
 +
echo "ILMBase Done"
 +
 
 +
echo "Applying patches for OpenEXR... "
 
cd  ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}
 
cd  ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
Line 154: Line 203:
 
done
 
done
  
echo "Configuring"
+
# Now the temp/openexr dir exists, we can add it to paths
 +
if [ -d "${SYN_TEMP_INSTALL}/openexr" ]; then
 +
  PATH="${SYN_TEMP_INSTALL}/openexr/bin:${PATH}"
 +
  PKG_CONFIG_PATH="${SYN_TEMP_INSTALL}/openexr/lib/pkgconfig:${PKG_CONFIG_PATH}"
 +
fi
 +
 
 +
export PATH
 +
export PKG_CONFIG_PATH
 +
 
 +
echo "Configuring OpenEXR"
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
./configure --host=${MINGW_HOST} --prefix=${SYN_TEMP_INSTALL}/openexr \
+
./configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=${SYN_TEMP_INSTALL}/openexr \
   --disable-static --disable-threading --disable-posix-sem
+
   --disable-static --disable-threading --disable-posix-sem --disable-ilmbasetest
 +
[ $? -eq 0 ] || exit 1
 +
 
 +
echo "separately build b44ExpLogTable as the openexr script doesn't work under msys"
 +
cd  ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}/IlmImf
 +
[ $? -eq 0 ] || exit 1
 +
mingw32-g++ --verbose -g -O2 -I${SYN_TEMP_INSTALL}/openexr/include/OpenEXR -L${SYN_TEMP_INSTALL}/openexr/lib b44ExpLogTable.cpp  -lHalf -o b44ExpLogTable
 +
[ $? -eq 0 ] || exit 1
 +
cd ..
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
  
Line 167: Line 233:
 
cd ${CURRENT_DIR}
 
cd ${CURRENT_DIR}
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
rm -rf ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}
+
# rm -rf ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}
[ $? -eq 0 ] || exit 1
+
# [ $? -eq 0 ] || exit 1
  
 
echo "Done: OpenEXR"
 
echo "Done: OpenEXR"
</pre></td></tr></table>
+
</nowiki></pre></code>
  
Save ETL build script as <code>C:\msys\1.0\home\<windows login>\synfig\make_etl.sh</code>:
+
Save ETL build script as <code>C:\mingw\msys\1.0\home\<windows login>\synfig\make_etl.sh</code>:
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
+
<code><pre><nowiki>
<pre>#!/bin/sh
+
#!/bin/sh
  
 
echo "Making ETL..."
 
echo "Making ETL..."
Line 212: Line 278:
  
 
echo "Configuring"
 
echo "Configuring"
./bootstrap
+
autoreconf -if
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
./configure --host=${MINGW_HOST} --prefix=${SYN_TEMP_INSTALL}/ETL
+
./configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=${SYN_TEMP_INSTALL}/ETL
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
  
Line 226: Line 292:
  
 
echo "Done: ETL"
 
echo "Done: ETL"
</pre></td></tr></table>
+
</nowiki></pre></code>
  
Save Synfig Core build script as <code>C:\msys\1.0\home\<windows login>\synfig\make_core.sh</code>:
+
Save Synfig Core build script as <code>C:\mingw\msys\1.0\home\<windows login>\synfig\make_core.sh</code>:
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
+
<code><pre><nowiki>
<pre>#!/bin/sh
+
#!/bin/sh
  
 
echo "Making Synfig-Core..."
 
echo "Making Synfig-Core..."
Line 267: Line 333:
  
 
echo "Configuring"
 
echo "Configuring"
./bootstrap
+
libtoolize --ltdl --copy -f
 +
autoreconf -if
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
 
mkdir win32build
 
mkdir win32build
Line 274: Line 341:
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
 
if [ "$SYN_CORE_DEBUG_BUILD" == "yes" ]; then
 
if [ "$SYN_CORE_DEBUG_BUILD" == "yes" ]; then
   ../configure --host=${MINGW_HOST} --prefix=C:/PROGRA~1/Synfig --disable-optimization --enable-debug
+
   ../configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=C:/PROGRA~1/Synfig --disable-optimization --enable-debug
 
   [ $? -eq 0 ] || exit 1
 
   [ $? -eq 0 ] || exit 1
 
else
 
else
   ../configure --host=${MINGW_HOST} --prefix=C:/PROGRA~1/Synfig --enable-optimization=1 --disable-debug
+
   ../configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=C:/PROGRA~1/Synfig --enable-optimization=1 --disable-debug
 
   [ $? -eq 0 ] || exit 1
 
   [ $? -eq 0 ] || exit 1
 
fi
 
fi
Line 322: Line 389:
  
 
echo "Done: synfig-core"
 
echo "Done: synfig-core"
</pre></td></tr></table>
+
</nowiki></pre></code>
  
 
Save Synfig Studio build script as <code>C:\msys\1.0\home\<windows login>\synfig\make_studio.sh</code>:
 
Save Synfig Studio build script as <code>C:\msys\1.0\home\<windows login>\synfig\make_studio.sh</code>:
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
+
<code><pre><nowiki>
<pre>#!/bin/sh
+
#!/bin/sh
  
 
echo "Making Synfig-Studio..."
 
echo "Making Synfig-Studio..."
Line 361: Line 428:
  
 
echo "Configuring"
 
echo "Configuring"
./bootstrap
+
autoreconf -if
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
 
mkdir win32build
 
mkdir win32build
Line 368: Line 435:
 
[ $? -eq 0 ] || exit 1
 
[ $? -eq 0 ] || exit 1
 
if [ "$SYN_STUDIO_DEBUG_BUILD" == "yes" ]; then
 
if [ "$SYN_STUDIO_DEBUG_BUILD" == "yes" ]; then
   ../configure --host=${MINGW_HOST} --prefix=C:/PROGRA~1/Synfig --disable-optimization --enable-debug
+
   ../configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=C:/PROGRA~1/Synfig --disable-optimization --enable-debug
 
   [ $? -eq 0 ] || exit 1
 
   [ $? -eq 0 ] || exit 1
 
else
 
else
   ../configure --host=${MINGW_HOST} --prefix=C:/PROGRA~1/Synfig --enable-optimization=1 --disable-debug
+
   ../configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=C:/PROGRA~1/Synfig --enable-optimization=1 --disable-debug
 
   [ $? -eq 0 ] || exit 1
 
   [ $? -eq 0 ] || exit 1
 
fi
 
fi
Line 387: Line 454:
  
 
echo "Done: synfig-studio"
 
echo "Done: synfig-studio"
</pre></td></tr></table>
+
</nowiki></pre></code>
  
 
===_src directory===
 
===_src directory===
 
Go to the <code>C:\msys\1.0\home\<windows login>\synfig\_src</code> directory. Get the latest sources of Synfig from its repository.
 
Go to the <code>C:\msys\1.0\home\<windows login>\synfig\_src</code> directory. Get the latest sources of Synfig from its repository.
  
<blockquote><nowiki>$ svn co http://svn.voria.com/code/ETL/trunk/ ETL</nowiki><br />
+
:: <code>'''$ svn co <nowiki>https://synfig.svn.sourceforge.net/svnroot/synfig/ETL/trunk/&nbsp;</nowiki> ETL'''</code><br />
<nowiki>$ svn co http://svn.voria.com/code/synfig-core/trunk/ synfig-core</nowiki><br />
+
:: <code>'''$ svn co <nowiki>https://synfig.svn.sourceforge.net/svnroot/synfig/synfig-core/trunk/&nbsp;</nowiki> synfig-core'''</code><br />
<nowiki>$ svn co http://svn.voria.com/code/synfig-studio/trunk/ synfig-studio</nowiki></blockquote>
+
:: <code>'''$ svn co <nowiki>https://synfig.svn.sourceforge.net/svnroot/synfig/synfig-studio/trunk/&nbsp;</nowiki> synfig-studio'''</code><br />
 +
 
 +
'''Note:''' The commands have a space between the URL address and the third paramater, it's easy to miss it. There should be three, space separated, paramaters in total after the "'''svn'''" command.
  
 
Download the current stable [http://www.openexr.com/ OpenEXR] version from:
 
Download the current stable [http://www.openexr.com/ OpenEXR] version from:
  
* http://download.savannah.nongnu.org/releases/openexr/openexr-1.4.0a.tar.gz (9.22 Mb)
+
* http://download.savannah.gnu.org/releases-noredirect/openexr/ilmbase-1.0.1.tar.gz (452 KB)
 +
* http://download.savannah.gnu.org/releases-noredirect/openexr/openexr-1.6.1.tar.gz (13 MB)
 +
 
 +
Finally, you must have three directories (ETL, synfig-core and synfig-studio) and the ilmbase-1.0.1.tar.gz & openexr-1.6.1.tar.gz files in your <code>'''_src'''</code> directory.
  
Finally you must have three directories (ETL, synfig-core and synfig-studio) and the openexr-1.4.0a.tar.gz file in your <code>_src</code> directory.
+
The scripts also create <code>C:\msys\1.0\home\<windows login>\synfig\_filez\config-cache</code>. To avoid the delay due to configuration autodetection keep this file until your build environment changes (i.e. you change some file related to MingW/msys, not Synfig).
  
 
===_filez directory===
 
===_filez directory===
Save the following text as <code>C:\msys\1.0\home\<windows login>\synfig\_filez\synfig-core-hack-libtool.patch</code>:
+
Save the following text as <code>'''C:\msys\1.0\home\<windows login>\synfig\_filez\synfig-core-hack-libtool.patch'''</code>:
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
+
<code><pre><nowiki>
<pre>diff -Nuar synfig-core.orig/win32build/libtool synfig-core/win32build/libtool
+
diff -Nuar synfig-core.orig/win32build/libtool synfig-core/win32build/libtool
 
--- synfig-core.orig/win32build/libtool Wed Feb  7 21:52:34 2007
 
--- synfig-core.orig/win32build/libtool Wed Feb  7 21:52:34 2007
 
+++ synfig-core/win32build/libtool Wed Feb  7 21:57:12 2007
 
+++ synfig-core/win32build/libtool Wed Feb  7 21:57:12 2007
Line 417: Line 489:
 
      # but the system doesn't support it.
 
      # but the system doesn't support it.
 
   
 
   
</pre></td></tr></table>
+
</nowiki></pre></code>
  
Then save the following as <code>C:\msys\1.0\home\<windows login>\synfig\_filez\openexr-1.4.0-mingw32.patch</code>:
+
Then save the following as <code>'''C:\msys\1.0\home\<windows login>\synfig\_filez\ilmbase-1.0.1-makefile.patch'''</code>:
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
+
<code><pre><nowiki>
<pre>diff -Nuar openexr-1.4.0.orig/IlmThread/Makefile.in openexr-1.4.0/IlmThread/Makefile.in
+
diff -Nuar ilmbase-1.0.1.orig/IlmThread/Makefile.in ilmbase-1.0.1/IlmThread/Makefile.in
--- openexr-1.4.0.orig/IlmThread/Makefile.in Wed Aug 9 05:45:52 2006
+
--- ilmbase-1.0.1.orig/IlmThread/Makefile.in Tue Oct 9 14:28:29 2007
+++ openexr-1.4.0/IlmThread/Makefile.in Wed Apr 18 20:31:58 2007
+
+++ ilmbase-1.0.1/IlmThread/Makefile.in Sat Aug 16 18:35:08 2008
@@ -62,7 +62,8 @@
+
@@ -64,7 +64,8 @@
 
  am_libIlmThread_la_OBJECTS = IlmThreadPool.lo IlmThread.lo \
 
  am_libIlmThread_la_OBJECTS = IlmThreadPool.lo IlmThread.lo \
 
  IlmThreadSemaphore.lo IlmThreadMutex.lo IlmThreadPosix.lo \
 
  IlmThreadSemaphore.lo IlmThreadMutex.lo IlmThreadPosix.lo \
Line 434: Line 506:
 
  DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
 
  DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
 
  depcomp = $(SHELL) $(top_srcdir)/depcomp
 
  depcomp = $(SHELL) $(top_srcdir)/depcomp
</pre></td></tr></table>
+
</nowiki></pre></code>
  
Finally save the following as <code>C:\msys\1.0\home\<windows login>\synfig\_filez\openexr-1.4.0-pkgconfig.patch</code>:
+
Finally save the following as <code>'''C:\msys\1.0\home\<windows login>\synfig\_filez\ilmbase-1.0.1-pkgconfig.patch'''</code>:
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
+
<code><pre><nowiki>
<pre>diff -Nuar openexr-1.4.0.orig/OpenEXR.pc.in openexr-1.4.0/OpenEXR.pc.in
+
diff -Nuar ilmbase-1.0.1.orig/IlmBase.pc.in ilmbase-1.0.1/IlmBase.pc.in
--- openexr-1.4.0.orig/OpenEXR.pc.in Wed Aug  9 05:37:50 2006
+
--- ilmbase-1.0.1.orig/IlmBase.pc.in Wed Dec 13 14:55:53 2006
+++ openexr-1.4.0/OpenEXR.pc.in Fri Apr 20 20:52:46 2007
+
+++ ilmbase-1.0.1/IlmBase.pc.in Sat Aug 16 21:06:27 2008
 
@@ -7,5 +7,5 @@
 
@@ -7,5 +7,5 @@
  Name: OpenEXR
+
  Name: IlmBase
  Description: OpenEXR image library
+
  Description: Base math and exception libraries
  Version: @OPENEXR_VERSION@
+
  Version: @ILMBASE_VERSION@
-Libs: -L${libdir} -lIlmImf -lImath -lHalf -lIex -lz @PTHREAD_LIBS@
+
-Libs: -L${libdir} -lImath -lHalf -lIex -lIlmThread @PTHREAD_LIBS@
 
-Cflags: @PTHREAD_CFLAGS@ -I${OpenEXR_includedir}
 
-Cflags: @PTHREAD_CFLAGS@ -I${OpenEXR_includedir}
+Libs: -L${libdir} -lIlmImf -lImath -lHalf -lIex -lz
+
+Libs: -L${libdir} -lImath -lHalf -lIex -lIlmThread
 
+Cflags: -I@includedir@ -I${OpenEXR_includedir}
 
+Cflags: -I@includedir@ -I${OpenEXR_includedir}
</pre></td></tr></table>
+
</nowiki></pre></code>
 +
 
 +
<s>Last but not least, prior to SVN 2055, the Windows installer files need patching - http://patches.synfig.org/r/3/</s> -- ''(it's been done)''.
 +
 
 +
(Acknowledgment to the writer of http://qtpfsgui.wiki.sourceforge.net/Compiling+on+Windows for the tip on the b44ExpLogTable file in OpenEXR)
  
 
==Configuration==
 
==Configuration==
Line 455: Line 531:
  
 
===Files and Directories===
 
===Files and Directories===
As you can see in this section you can define the path and name of the special directories (with sources, patches and temporary directories). If you install the build scripts as written above, there nothing to change.
+
As you can see in this section you can define the path and name of the special directories (with sources, patches and temporary directories). If you install the build scripts as written above, there is nothing to change.
  
 
Also this section contains the path and version of the OpenEXR source files.
 
Also this section contains the path and version of the OpenEXR source files.
  
 
===External tools===
 
===External tools===
In this section you need to define the path to the executable files of the three auxiliary packages: ImageMagick, Subversion and NSIS. ImageMagick and Subversion are set it paths to PATH environment variable. But it add its to the end of list and we can get name collision. For example, "convert" tool from ImageMagick name some like "convert" tool from Borland Delphi Explorer, which can be installed before ImageMagick.
+
In this section you need to define the path to the executable files of the three auxiliary packages: ImageMagick, Subversion and NSIS. ImageMagick and Subversion binaries are located using the PATH environment variable, but their paths are added to the end of the path list and so we can get name collisions. For example, the ImageMagick "convert" tool has the same name as the "convert" tool from Borland Delphi Explorer, which may have been installed before ImageMagick.
  
 
===Build setup===
 
===Build setup===
 
'''MINGW_HOST''' - host parameter of "configure" script. Do not change it.
 
'''MINGW_HOST''' - host parameter of "configure" script. Do not change it.
  
'''SYN_CORE_DEBUG_BUILD''' - if "yes", Synfig Core will maked with debug info.
+
'''SYN_CORE_DEBUG_BUILD''' - if "yes", Synfig Core will be made with debug info.
  
'''SYN_STUDIO_DEBUG_BUILD''' - if "yes", Synfig Studio will maked with debug info.
+
'''SYN_STUDIO_DEBUG_BUILD''' - if "yes", Synfig Studio will be made with debug info.
  
 
===Patches===
 
===Patches===
In this section you can find a number of patches definition blocks, looking like this:
+
In this section you can find a number of patch definition blocks, looking like this:
  
 
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
 
<table style="padding: 1em; border: 1px dashed #2f6fab; color: Black; background-color: #f9f9f9; line-height: 1.1em;"><tr><td>
Line 477: Line 553:
 
:END_ETL:)</pre></td></tr></table>
 
:END_ETL:)</pre></td></tr></table>
  
For example, if you place any filenames of patches between '':END_ETL:'' blocks, it will be applied before configuration of ETL. Patch files need to be stored into <code>_filez</code> directory.
+
For example, if you place any filenames of patches between '':END_ETL:'' blocks, it will be applied before the configuration of ETL. Patch files need to be stored in the <code>_filez</code> directory.
  
This section is useful if you want to test your own patches before send it to Synfig developers.
+
This section is useful if you want to test your own patches before sending them to the Synfig developers.
  
 
===Autoconfiguration===
 
===Autoconfiguration===
This section contatin code, which setup required environment variables and (by default) there no need to be changed.
+
This section contatins code which sets up the required environment variables and (by default) there is no need to change anything.
  
 
==Build Order==
 
==Build Order==
Note: If you want build synfig without lags, open a single msys session, then open "Task Manager", search for ''sh.exe'' process and set priority "Below normal" to it.
+
Note: If you want build synfig without slowing down other tasks running on the same machine while the build takes place, open a single msys session, then open "Task Manager", search for the ''sh.exe'' process and set its priority to "Below normal".
  
Note: On-access antivirus scanner can dramatically decrease configuration speed.
+
Note: Running an on-access antivirus scanner can dramatically decrease compilation speed.
  
 
===OpenEXR===
 
===OpenEXR===
This package need to build only once. Rebuild is required if you get new version or want apply new patch to it or you update the compiler and its incompatible with oldest binaries.
+
This package needs to be built only once. A rebuild is only required if you get a new version or want to apply a new patch to it or you update the compiler and it is incompatible with the previous binaries.
  
In your msys console goto <code>C:\msys\1.0\home\<windows login>\synfig</code> directory by typing:
+
In your msys console go to the <code>C:\msys\1.0\home\<windows login>\synfig</code> directory by typing:
  
 
<blockquote><nowiki>$ cd ~/synfig</nowiki></blockquote>
 
<blockquote><nowiki>$ cd ~/synfig</nowiki></blockquote>
Line 500: Line 576:
 
<blockquote><nowiki>$ ./make_openexr.sh</nowiki></blockquote>
 
<blockquote><nowiki>$ ./make_openexr.sh</nowiki></blockquote>
  
Wait for "Done: OpenEXR" string.
+
Wait for the "Done: OpenEXR" message.
  
 
===ETL===
 
===ETL===
Rebuild it when you get new version of Synfig.
+
Rebuild it when you get a new version of Synfig.
  
In your msys console goto <code>C:\msys\1.0\home\<windows login>\synfig</code> directory by typing:
+
In your msys console go to the <code>C:\msys\1.0\home\<windows login>\synfig</code> directory by typing:
  
 
<blockquote><nowiki>$ cd ~/synfig</nowiki></blockquote>
 
<blockquote><nowiki>$ cd ~/synfig</nowiki></blockquote>
Line 513: Line 589:
 
<blockquote><nowiki>$ ./make_etl.sh</nowiki></blockquote>
 
<blockquote><nowiki>$ ./make_etl.sh</nowiki></blockquote>
  
Wait for "Done: ETL" string.
+
Wait for the "Done: ETL" message.
  
 
===Synfig Core===
 
===Synfig Core===
Rebuild it when you get new version of Synfig.
+
Rebuild it when you get a new version of Synfig.
  
In your msys console goto <code>C:\msys\1.0\home\<windows login>\synfig</code> directory by typing:
+
In your msys console go to the <code>C:\msys\1.0\home\<windows login>\synfig</code> directory by typing:
  
 
<blockquote><nowiki>$ cd ~/synfig</nowiki></blockquote>
 
<blockquote><nowiki>$ cd ~/synfig</nowiki></blockquote>
Line 526: Line 602:
 
<blockquote><nowiki>$ ./make_core.sh</nowiki></blockquote>
 
<blockquote><nowiki>$ ./make_core.sh</nowiki></blockquote>
  
Wait for "Done: synfig-core" string. It can take along time. Synfig Core installer will be moved into current directory.
+
Wait for the "Done: synfig-core" message. It can take a long time. The Synfig Core installer will be moved into the current directory.
  
 
===Synfig Studio===
 
===Synfig Studio===
Rebuild it when you get new version of Synfig.
+
Rebuild it when you get a new version of Synfig.
  
In your msys console goto <code>C:\msys\1.0\home\<windows login>\synfig</code> directory by typing:
+
In your msys console go to the <code>C:\msys\1.0\home\<windows login>\synfig</code> directory by typing:
  
 
<blockquote><nowiki>$ cd ~/synfig</nowiki></blockquote>
 
<blockquote><nowiki>$ cd ~/synfig</nowiki></blockquote>
Line 539: Line 615:
 
<blockquote><nowiki>$ ./make_studio.sh</nowiki></blockquote>
 
<blockquote><nowiki>$ ./make_studio.sh</nowiki></blockquote>
  
Wait for "Done: synfig-studio" string. It can take along time. Synfig Studio installer will be moved into current directory.
+
Wait for the "Done: synfig-studio" message. It can take a long time. The Synfig Studio installer will be moved into the current directory.
  
 
==Additional tools==
 
==Additional tools==
This tools is not required for Synfig building, but its can help in debugging process.
+
These tools are not required to build Synfig, but they can help in the debugging process.
  
 
P.S. Post this later. ;-)
 
P.S. Post this later. ;-)
  
[[Category:Windows]]
+
(Atrus - keen to hear what you recommend for debug.  Also any debug processes you go through to fix the bugs.  There's several bugs (mainly preview rendering) that I see under the current builds of Windows that are not under Linux or the old 0.61.05 for Windows - Pxegeek 2/7/07)
 +
 
 +
{{Category|Windows}}

Latest revision as of 03:31, 25 January 2011


Directories

If you didn't already install Mingw, this page will guide you through the process.

If you didn't already start an msys session, do so now. Just double click the MSYS shortcut or run C:\mingw\msys\1.0\msys.bat. An msys session will be opened, creating your profile directory at C:\mingw\msys\1.0\home\<windows login>. As you can see, MinGW uses your windows login as the user name in its fake UNIX environment. Be careful, I've not checked whether it works with non latin-character account names.

Now, use explorer or your favorite file manager and go to C:\mingw\msys\1.0\home\<windows login>. Create a directory there for all Synfig operations. For example, let it be synfig. Go into this directory.

Ok, now you are at C:\msys\1.0\home\<windows login>\synfig. Create four directories here:

  • _filez, for patches (and maybe later, additional files).
  • _src, for program sources.
  • build, for building programs.
  • temp, for local installation programs and libraries, which are required for building synfig. (For example: ETL, synfig (core for studio), OpenEXR, etc...)

Of course, you can choose your own name for all the directories and choose their locations. All you need then is to set a new path in the configuration file. But for now we choose the easy way.

Files

Save this configuration file as C:\mingw\msys\1.0\home\<windows login>\synfig\synbuild.conf:

# Synfig for Win32 build configuration script.
############################################################################
# 1. Files and Directories

# Uncompressed Synfig svn snapshots and another package sources
SYN_SOURCE_DIR=`dirname ~/.`"/synfig/_src"

# Directory additional files (patches f.e.)
SYN_FILEZ_DIR=`dirname ~/.`"/synfig/_filez"

# Temporary installations (ETL headers, synfig binaries for icon and image making)
SYN_TEMP_INSTALL=`dirname ~/.`"/synfig/temp"

# Build directory
SYN_BUILD_DIR=`dirname ~/.`"/synfig/build"

# OpenEXR source package
SYN_ILMBASE_VERSION="1.0.1"
SYN_ILMBASE_SRC="${SYN_SOURCE_DIR}/ilmbase-${SYN_ILMBASE_VERSION}.tar.gz"
SYN_OPENEXR_VERSION="1.6.1"
SYN_OPENEXR_SRC="${SYN_SOURCE_DIR}/openexr-${SYN_OPENEXR_VERSION}.tar.gz"

#############################################################################
# 2. External tools

# Path to ImageMagick directory.
SYN_IMAGEMAGICK_PATH="/C/Program Files/ImageMagick"

# Path to Subversion bin directory.
SYN_SUBVERSION_PATH="/C/Program Files/Subversion/bin"

# Path to NSIS directory with makensis.exe file.
SYN_NSIS_PATH="/C/Program Files/NSIS"

#############################################################################
# 3. Build setup

# Build host
MINGW_HOST="mingw32"

# Make debug build of Synfig Core
SYN_CORE_DEBUG_BUILD="no"

# Make debug build of Synfig Studio
SYN_STUDIO_DEBUG_BUILD="no"
#WITH_FMOD="yes"

#############################################################################
# 4. Patches (you can place here any additional patches)

# ETL patches
ETL_PATCHES=$(cat <<:END_ETL:
:END_ETL:)

# Synfig Core patches
SYNCORE_PATCHES=$(cat <<:END_SYNCORE:
:END_SYNCORE:)

# Sunfig Studio patches
SYNSTUDIO_PATCHES=$(cat <<:END_SYNSTUDIO:
:END_SYNSTUDIO:)

# OpenEXR ILMBase patches

ILMBASE_PATCHES=$(cat <<:END_ILMBASE:
ilmbase-1.0.1-makefile.patch
ilmbase-1.0.1-pkgconfig.patch
:END_ILMBASE:)

# OpenEXR patches
#openexr-1.4.0-pkgconfig.patch
#openexr-1.4.0-mingw32.patch
OPENEXR_PATCHES=$(cat <<:END_OPENEXR:
:END_OPENEXR:)

#############################################################################
# 5. Autoconfiguration

if [ "$GTK_BASEPATH" ]; then
  CPPFLAGS="-I${GTK_BASEPATH}/include $CPPFLAGS"
fi

if [ "$SYN_IMAGEMAGICK_PATH" ]; then
  PATH="${SYN_IMAGEMAGICK_PATH}:${PATH}"
fi

if [ "$SYN_SUBVERSION_PATH" ]; then
  PATH="${SYN_SUBVERSION_PATH}:${PATH}"
fi

if [ "$SYN_NSIS_PATH" ]; then
  PATH="${SYN_NSIS_PATH}:${PATH}"
fi

if [ -d "${SYN_TEMP_INSTALL}/ETL" ]; then
  PATH="${SYN_TEMP_INSTALL}/ETL/bin:${PATH}"
  PKG_CONFIG_PATH="${SYN_TEMP_INSTALL}/ETL/lib/pkgconfig:${PKG_CONFIG_PATH}"
fi

if [ -d "${SYN_TEMP_INSTALL}/synfig-devel" ]; then
  PATH="${SYN_TEMP_INSTALL}/synfig-devel/bin:${PATH}"
  PKG_CONFIG_PATH="${SYN_TEMP_INSTALL}/synfig-devel/lib/pkgconfig:${PKG_CONFIG_PATH}"
fi

if [ -d "${SYN_TEMP_INSTALL}/openexr" ]; then
  PATH="${SYN_TEMP_INSTALL}/openexr/bin:${PATH}"
  PKG_CONFIG_PATH="${SYN_TEMP_INSTALL}/openexr/lib/pkgconfig:${PKG_CONFIG_PATH}"
fi

CPPFLAGS="-DSINGLE_THREADED $CPPFLAGS"

export PATH
export PKG_CONFIG_PATH
export CPPFLAGS

Save OpenEXR build script as C:\mingw\msys\1.0\home\<windows login>\synfig\make_openexr.sh:

#!/bin/sh

echo "Making OpenEXR..."
# Including configuration
if [ -r "./synbuild.conf" ]; then
  . ./synbuild.conf
else
  echo "No config file for synfig build (./synbuild.conf) found."
  exit 1
fi

CURRENT_DIR=`pwd`

echo "Cleanup directories"
rm -rf ${SYN_BUILD_DIR}/ilmbase-${SYN_ILMBASE_VERSION}
[ $? -eq 0 ] || exit 1
rm -rf ${SYN_TEMP_INSTALL}/ilmbase
[ $? -eq 0 ] || exit 1

rm -rf ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}
[ $? -eq 0 ] || exit 1
rm -rf ${SYN_TEMP_INSTALL}/openexr
[ $? -eq 0 ] || exit 1

echo "Preparing sources"
echo PATH is $PATH
echo tar -xzf ${SYN_ILMBASE_SRC} -C ${SYN_BUILD_DIR}
tar -xzf ${SYN_ILMBASE_SRC} -C ${SYN_BUILD_DIR}
[ $? -eq 0 ] || exit 1
echo tar -xzf ${SYN_OPENEXR_SRC} -C ${SYN_BUILD_DIR}
tar -xzf ${SYN_OPENEXR_SRC} -C ${SYN_BUILD_DIR}
[ $? -eq 0 ] || exit 1

echo "Applying patches for ILMBase... "
cd  ${SYN_BUILD_DIR}/ilmbase-${SYN_ILMBASE_VERSION}
[ $? -eq 0 ] || exit 1
for SFILE in ${ILMBASE_PATCHES[@]}
do
  patch -p1 <${SYN_FILEZ_DIR}/${SFILE}
  [ $? -eq 0 ] || exit 1
done

echo "Configuring ILMbase"
[ $? -eq 0 ] || exit 1
./configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=${SYN_TEMP_INSTALL}/openexr \
  --disable-static --disable-threading --disable-posix-sem
[ $? -eq 0 ] || exit 1

echo "Making"
make
[ $? -eq 0 ] || exit 1
make install
[ $? -eq 0 ] || exit 1
echo "ILMBase Done"

echo "Applying patches for OpenEXR... "
cd  ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}
[ $? -eq 0 ] || exit 1
for SFILE in ${OPENEXR_PATCHES[@]}
do
  patch -p1 <${SYN_FILEZ_DIR}/${SFILE}
  [ $? -eq 0 ] || exit 1
done

# Now the temp/openexr dir exists, we can add it to paths
if [ -d "${SYN_TEMP_INSTALL}/openexr" ]; then
  PATH="${SYN_TEMP_INSTALL}/openexr/bin:${PATH}"
  PKG_CONFIG_PATH="${SYN_TEMP_INSTALL}/openexr/lib/pkgconfig:${PKG_CONFIG_PATH}"
fi

export PATH
export PKG_CONFIG_PATH

echo "Configuring OpenEXR"
[ $? -eq 0 ] || exit 1
./configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=${SYN_TEMP_INSTALL}/openexr \
  --disable-static --disable-threading --disable-posix-sem  --disable-ilmbasetest
[ $? -eq 0 ] || exit 1

echo "separately build b44ExpLogTable as the openexr script doesn't work under msys"
cd  ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}/IlmImf
[ $? -eq 0 ] || exit 1
mingw32-g++ --verbose -g -O2 -I${SYN_TEMP_INSTALL}/openexr/include/OpenEXR -L${SYN_TEMP_INSTALL}/openexr/lib b44ExpLogTable.cpp  -lHalf -o b44ExpLogTable
[ $? -eq 0 ] || exit 1
cd ..
[ $? -eq 0 ] || exit 1

echo "Making"
make
[ $? -eq 0 ] || exit 1
make install
[ $? -eq 0 ] || exit 1
cd ${CURRENT_DIR}
[ $? -eq 0 ] || exit 1
# rm -rf ${SYN_BUILD_DIR}/openexr-${SYN_OPENEXR_VERSION}
# [ $? -eq 0 ] || exit 1

echo "Done: OpenEXR"

Save ETL build script as C:\mingw\msys\1.0\home\<windows login>\synfig\make_etl.sh:

#!/bin/sh

echo "Making ETL..."
# Including configuration
if [ -r "./synbuild.conf" ]; then
  . ./synbuild.conf
else
  echo "No config file for synfig build (./synbuild.conf) found."
  exit 1
fi

CURRENT_DIR=`pwd`

echo "Cleanup directories"
rm -rf ${SYN_BUILD_DIR}/ETL
[ $? -eq 0 ] || exit 1
rm -rf ${SYN_TEMP_INSTALL}/ETL
[ $? -eq 0 ] || exit 1

echo "Preparing sources"
mkdir  ${SYN_BUILD_DIR}/ETL
[ $? -eq 0 ] || exit 1
cp -R ${SYN_SOURCE_DIR}/ETL/*  ${SYN_BUILD_DIR}/ETL/
[ $? -eq 0 ] || exit 1
cp -R ${SYN_SOURCE_DIR}/ETL/.svn  ${SYN_BUILD_DIR}/ETL/
[ $? -eq 0 ] || exit 1

echo "Applying patches..."
cd  ${SYN_BUILD_DIR}/ETL
[ $? -eq 0 ] || exit 1
for SFILE in ${ETL_PATCHES[@]}
do
  patch -p1 <${SYN_FILEZ_DIR}/${SFILE}
  [ $? -eq 0 ] || exit 1
done

echo "Configuring"
autoreconf -if
[ $? -eq 0 ] || exit 1
./configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=${SYN_TEMP_INSTALL}/ETL
[ $? -eq 0 ] || exit 1

echo "Making"
make install
[ $? -eq 0 ] || exit 1
cd ${CURRENT_DIR}
[ $? -eq 0 ] || exit 1
rm -rf ${SYN_BUILD_DIR}/ETL
[ $? -eq 0 ] || exit 1

echo "Done: ETL"

Save Synfig Core build script as C:\mingw\msys\1.0\home\<windows login>\synfig\make_core.sh:

#!/bin/sh

echo "Making Synfig-Core..."
# Including configuration
if [ -r "./synbuild.conf" ]; then
  . ./synbuild.conf
else
  echo "No config file for synfig build (./synbuild.conf) found."
  exit 1
fi

CURRENT_DIR=`pwd`

echo "Cleanup directories"
rm -rf ${SYN_BUILD_DIR}/synfig-core
[ $? -eq 0 ] || exit 1
rm -rf ${SYN_TEMP_INSTALL}/synfig-devel
[ $? -eq 0 ] || exit 1

echo "Preparing sources"
mkdir ${SYN_BUILD_DIR}/synfig-core
[ $? -eq 0 ] || exit 1
cp -R ${SYN_SOURCE_DIR}/synfig-core/* ${SYN_BUILD_DIR}/synfig-core/
[ $? -eq 0 ] || exit 1
cp -R ${SYN_SOURCE_DIR}/synfig-core/.svn ${SYN_BUILD_DIR}/synfig-core/
[ $? -eq 0 ] || exit 1

echo "Applying patches..."
cd  ${SYN_BUILD_DIR}/synfig-core
[ $? -eq 0 ] || exit 1
for SFILE in ${SYNCORE_PATCHES[@]}
do
  patch -p1 <${SYN_FILEZ_DIR}/${SFILE}
  [ $? -eq 0 ] || exit 1
done

echo "Configuring"
libtoolize --ltdl --copy -f
autoreconf -if
[ $? -eq 0 ] || exit 1
mkdir win32build
[ $? -eq 0 ] || exit 1
cd win32build
[ $? -eq 0 ] || exit 1
if [ "$SYN_CORE_DEBUG_BUILD" == "yes" ]; then
  ../configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=C:/PROGRA~1/Synfig --disable-optimization --enable-debug
  [ $? -eq 0 ] || exit 1
else
  ../configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=C:/PROGRA~1/Synfig --enable-optimization=1 --disable-debug
  [ $? -eq 0 ] || exit 1
fi

echo "Making"
# libtool hack patch [begin]
patch -p2 <${SYN_FILEZ_DIR}/synfig-core-hack-libtool.patch
[ $? -eq 0 ] || exit 1
# libtool hack patch [end]
make package
[ $? -eq 0 ] || exit 1
mv ./synfig-*.exe ${CURRENT_DIR}/
[ $? -eq 0 ] || exit 1

make clean
[ $? -eq 0 ] || exit 1
# auto build hack installation [begin]
make install prefix=${SYN_TEMP_INSTALL}/synfig-devel
[ $? -eq 0 ] || exit 1
# auto build hack installation [end]
cd ${CURRENT_DIR}

# auto build hack patch [begin]
echo "Postprocessing"
SYN_SED_PATH=`echo ${SYN_TEMP_INSTALL}/synfig-devel | sed -e 's/\//\\\\\//g'`
[ $? -eq 0 ] || exit 1
mv ${SYN_TEMP_INSTALL}/synfig-devel/bin/synfig-config ${SYN_TEMP_INSTALL}/synfig-devel/bin/synfig-config.tmp
[ $? -eq 0 ] || exit 1
sed -e "s/C:\/PROGRA~1\\/Synfig/${SYN_SED_PATH}/g" \
  ${SYN_TEMP_INSTALL}/synfig-devel/bin/synfig-config.tmp >${SYN_TEMP_INSTALL}/synfig-devel/bin/synfig-config
[ $? -eq 0 ] || exit 1
rm -f ${SYN_TEMP_INSTALL}/synfig-devel/bin/synfig-config.tmp
[ $? -eq 0 ] || exit 1
mv ${SYN_TEMP_INSTALL}/synfig-devel/lib/pkgconfig/synfig.pc ${SYN_TEMP_INSTALL}/synfig-devel/lib/pkgconfig/synfig.pc.tmp
[ $? -eq 0 ] || exit 1
sed -e "s/C:\/PROGRA~1\\/Synfig/${SYN_SED_PATH}/g" \
  ${SYN_TEMP_INSTALL}/synfig-devel/lib/pkgconfig/synfig.pc.tmp >${SYN_TEMP_INSTALL}/synfig-devel/lib/pkgconfig/synfig.pc
[ $? -eq 0 ] || exit 1
rm -f ${SYN_TEMP_INSTALL}/synfig-devel/lib/pkgconfig/synfig.pc.tmp
[ $? -eq 0 ] || exit 1
# auto build hack patch [end]

rm -rf ${SYN_BUILD_DIR}/synfig-core

echo "Done: synfig-core"

Save Synfig Studio build script as C:\msys\1.0\home\<windows login>\synfig\make_studio.sh:

#!/bin/sh

echo "Making Synfig-Studio..."
# Including configuration
if [ -r "./synbuild.conf" ]; then
  . ./synbuild.conf
else
  echo "No config file for synfig build (./synbuild.conf) found."
  exit 1
fi

CURRENT_DIR=`pwd`

echo "Cleanup directories"
rm -rf ${SYN_BUILD_DIR}/synfig-studio
[ $? -eq 0 ] || exit 1

echo "Preparing sources"
mkdir ${SYN_BUILD_DIR}/synfig-studio
[ $? -eq 0 ] || exit 1
cp -R ${SYN_SOURCE_DIR}/synfig-studio/* ${SYN_BUILD_DIR}/synfig-studio/
[ $? -eq 0 ] || exit 1
cp -R ${SYN_SOURCE_DIR}/synfig-studio/.svn ${SYN_BUILD_DIR}/synfig-studio/
[ $? -eq 0 ] || exit 1

echo "Applying patches..."
cd  ${SYN_BUILD_DIR}/synfig-studio
[ $? -eq 0 ] || exit 1
for SFILE in ${SYNSTUDIO_PATCHES[@]}
do
  patch -p1 <${SYN_FILEZ_DIR}/${SFILE}
  [ $? -eq 0 ] || exit 1
done

echo "Configuring"
autoreconf -if
[ $? -eq 0 ] || exit 1
mkdir win32build
[ $? -eq 0 ] || exit 1
cd win32build
[ $? -eq 0 ] || exit 1
if [ "$SYN_STUDIO_DEBUG_BUILD" == "yes" ]; then
  ../configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=C:/PROGRA~1/Synfig --disable-optimization --enable-debug
  [ $? -eq 0 ] || exit 1
else
  ../configure --host=${MINGW_HOST} --cache-file=${SYN_FILEZ_DIR}/config-cache --prefix=C:/PROGRA~1/Synfig --enable-optimization=1 --disable-debug
  [ $? -eq 0 ] || exit 1
fi

echo "Making"
make package
[ $? -eq 0 ] || exit 1

mv ./synfigstudio-*.exe ${CURRENT_DIR}/
[ $? -eq 0 ] || exit 1
cd ${CURRENT_DIR}
[ $? -eq 0 ] || exit 1
rm -rf ${SYN_BUILD_DIR}/synfig-studio
[ $? -eq 0 ] || exit 1

echo "Done: synfig-studio"

_src directory

Go to the C:\msys\1.0\home\<windows login>\synfig\_src directory. Get the latest sources of Synfig from its repository.

$ svn co https://synfig.svn.sourceforge.net/svnroot/synfig/ETL/trunk/  ETL
$ svn co https://synfig.svn.sourceforge.net/svnroot/synfig/synfig-core/trunk/  synfig-core
$ svn co https://synfig.svn.sourceforge.net/svnroot/synfig/synfig-studio/trunk/  synfig-studio

Note: The commands have a space between the URL address and the third paramater, it's easy to miss it. There should be three, space separated, paramaters in total after the "svn" command.

Download the current stable OpenEXR version from:

Finally, you must have three directories (ETL, synfig-core and synfig-studio) and the ilmbase-1.0.1.tar.gz & openexr-1.6.1.tar.gz files in your _src directory.

The scripts also create C:\msys\1.0\home\<windows login>\synfig\_filez\config-cache. To avoid the delay due to configuration autodetection keep this file until your build environment changes (i.e. you change some file related to MingW/msys, not Synfig).

_filez directory

Save the following text as C:\msys\1.0\home\<windows login>\synfig\_filez\synfig-core-hack-libtool.patch:

diff -Nuar synfig-core.orig/win32build/libtool synfig-core/win32build/libtool
--- synfig-core.orig/win32build/libtool	Wed Feb  7 21:52:34 2007
+++ synfig-core/win32build/libtool	Wed Feb  7 21:57:12 2007
@@ -2805,7 +2805,7 @@
 	  fi
 	elif test "$build_libtool_libs" = yes; then
 	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
+	  if test "$deplibs_check_method" != pass_all && test "$old_library" != "libltdl.a"; then
 	    # We're trying link a shared library against a static one
 	    # but the system doesn't support it.
 

Then save the following as C:\msys\1.0\home\<windows login>\synfig\_filez\ilmbase-1.0.1-makefile.patch:

diff -Nuar ilmbase-1.0.1.orig/IlmThread/Makefile.in ilmbase-1.0.1/IlmThread/Makefile.in
--- ilmbase-1.0.1.orig/IlmThread/Makefile.in	Tue Oct  9 14:28:29 2007
+++ ilmbase-1.0.1/IlmThread/Makefile.in	Sat Aug 16 18:35:08 2008
@@ -64,7 +64,8 @@
 am_libIlmThread_la_OBJECTS = IlmThreadPool.lo IlmThread.lo \
 	IlmThreadSemaphore.lo IlmThreadMutex.lo IlmThreadPosix.lo \
 	IlmThreadSemaphorePosix.lo IlmThreadSemaphorePosixCompat.lo \
-	IlmThreadMutexPosix.lo
+	IlmThreadMutexPosix.lo IlmThreadWin32.lo IlmThreadSemaphoreWin32.lo \
+	IlmThreadMutexWin32.lo
 libIlmThread_la_OBJECTS = $(am_libIlmThread_la_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
 depcomp = $(SHELL) $(top_srcdir)/depcomp

Finally save the following as C:\msys\1.0\home\<windows login>\synfig\_filez\ilmbase-1.0.1-pkgconfig.patch:

diff -Nuar ilmbase-1.0.1.orig/IlmBase.pc.in ilmbase-1.0.1/IlmBase.pc.in
--- ilmbase-1.0.1.orig/IlmBase.pc.in	Wed Dec 13 14:55:53 2006
+++ ilmbase-1.0.1/IlmBase.pc.in	Sat Aug 16 21:06:27 2008
@@ -7,5 +7,5 @@
 Name: IlmBase
 Description: Base math and exception libraries
 Version: @ILMBASE_VERSION@
-Libs: -L${libdir} -lImath -lHalf -lIex -lIlmThread @PTHREAD_LIBS@
-Cflags: @PTHREAD_CFLAGS@ -I${OpenEXR_includedir}
+Libs: -L${libdir} -lImath -lHalf -lIex -lIlmThread
+Cflags: -I@includedir@ -I${OpenEXR_includedir}

Last but not least, prior to SVN 2055, the Windows installer files need patching - http://patches.synfig.org/r/3/ -- (it's been done).

(Acknowledgment to the writer of http://qtpfsgui.wiki.sourceforge.net/Compiling+on+Windows for the tip on the b44ExpLogTable file in OpenEXR)

Configuration

This section describes the parameters of synbuild.conf file.

Files and Directories

As you can see in this section you can define the path and name of the special directories (with sources, patches and temporary directories). If you install the build scripts as written above, there is nothing to change.

Also this section contains the path and version of the OpenEXR source files.

External tools

In this section you need to define the path to the executable files of the three auxiliary packages: ImageMagick, Subversion and NSIS. ImageMagick and Subversion binaries are located using the PATH environment variable, but their paths are added to the end of the path list and so we can get name collisions. For example, the ImageMagick "convert" tool has the same name as the "convert" tool from Borland Delphi Explorer, which may have been installed before ImageMagick.

Build setup

MINGW_HOST - host parameter of "configure" script. Do not change it.

SYN_CORE_DEBUG_BUILD - if "yes", Synfig Core will be made with debug info.

SYN_STUDIO_DEBUG_BUILD - if "yes", Synfig Studio will be made with debug info.

Patches

In this section you can find a number of patch definition blocks, looking like this:

# ETL patches
ETL_PATCHES=$(cat <<:END_ETL:
:END_ETL:)

For example, if you place any filenames of patches between :END_ETL: blocks, it will be applied before the configuration of ETL. Patch files need to be stored in the _filez directory.

This section is useful if you want to test your own patches before sending them to the Synfig developers.

Autoconfiguration

This section contatins code which sets up the required environment variables and (by default) there is no need to change anything.

Build Order

Note: If you want build synfig without slowing down other tasks running on the same machine while the build takes place, open a single msys session, then open "Task Manager", search for the sh.exe process and set its priority to "Below normal".

Note: Running an on-access antivirus scanner can dramatically decrease compilation speed.

OpenEXR

This package needs to be built only once. A rebuild is only required if you get a new version or want to apply a new patch to it or you update the compiler and it is incompatible with the previous binaries.

In your msys console go to the C:\msys\1.0\home\<windows login>\synfig directory by typing:

$ cd ~/synfig

Then type:

$ ./make_openexr.sh

Wait for the "Done: OpenEXR" message.

ETL

Rebuild it when you get a new version of Synfig.

In your msys console go to the C:\msys\1.0\home\<windows login>\synfig directory by typing:

$ cd ~/synfig

Then type:

$ ./make_etl.sh

Wait for the "Done: ETL" message.

Synfig Core

Rebuild it when you get a new version of Synfig.

In your msys console go to the C:\msys\1.0\home\<windows login>\synfig directory by typing:

$ cd ~/synfig

Then type:

$ ./make_core.sh

Wait for the "Done: synfig-core" message. It can take a long time. The Synfig Core installer will be moved into the current directory.

Synfig Studio

Rebuild it when you get a new version of Synfig.

In your msys console go to the C:\msys\1.0\home\<windows login>\synfig directory by typing:

$ cd ~/synfig

Then type:

$ ./make_studio.sh

Wait for the "Done: synfig-studio" message. It can take a long time. The Synfig Studio installer will be moved into the current directory.

Additional tools

These tools are not required to build Synfig, but they can help in the debugging process.

P.S. Post this later. ;-)

(Atrus - keen to hear what you recommend for debug. Also any debug processes you go through to fix the bugs. There's several bugs (mainly preview rendering) that I see under the current builds of Windows that are not under Linux or the old 0.61.05 for Windows - Pxegeek 2/7/07)