<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<article lang="en">
  <articleinfo>
    <title>How to compile Dia</title>
    <copyright>
      <year>2003</year>
      <year>2004</year>
      <year>2007</year>
      <year>2008</year>
      <year>2009</year>
      <year>2011</year>
	  <year>2012</year>
          <year>2013</year>
	  <year>2014</year>
      <holder>Steffen Macke</holder>
    </copyright>

    <author>
      <personname>
        <firstname>Steffen</firstname>
        <surname>Macke</surname>
      </personname>

      <email>sdteffen@gmail.com</email>
    </author>
  </articleinfo>

  <sect1 id="introduction">
    <title>Introduction</title>

    <para>This document describes (step by step) how to compile Dia 
    on Windows, Mac OS X and Ubuntu.</para>

	<para>Dia is a diagram editor. More information about dia is available from <ulink
    url="http://dia-installer.de">http://dia-installer.de</ulink>.</para>
  </sect1>
  
  <sect1 id="dia_development_vm">
  	<title>Dia Development VM</title>
  	<para>The Dia Development VM allows to compile the latest Dia version using a single mouse click.
  		The VM uses Ubuntu and is available from <ulink url="http://dia-installer.de/developer/">http://dia-installer.de/developer/</ulink>.</para>
  </sect1>

  <sect1 id="windows">
    <title>Compiling Dia for Windows</title>
   <para>This section describes how to compile Dia for Windows using Microsoft Visual C++ Version 6.0 
    and the GTK+ Development Environment.</para>

    <sect2 id="folder_structure">
    	<title>Folder structure</title>
    	<para>Understanding the folder structure is helpful especially
    		when unzipping developer packages:</para>
    	<screen>
    	c:\gtk
    	     |
    	     +---bin
    	     |
    	     +---include
    	     |
    	     +---lib
    	</screen>
    	<para>Sometimes the zip files contain the <filename>bin</filename>, 
    		<filename>include</filename> and <filename>lib</filename> 
    		inside another folder. While unzipping, make sure that their contents
    		end up in <filename>c:\gtk\bin</filename>, 
    		<filename>c:\gtk\include</filename> and 
    		<filename>c:\gtk\lib</filename>.</para>
    </sect2>	
    
  <sect2 id="installation">
    <title>Installing the required software</title>
    <sect3 id="install_msvc">
    	<title>Install Microsoft Visual C++ Version 6.0</title>
<para>Start the Visual C++ Installation Wizard (<xref linkend="fig_visual_cpp6" 
	/>) and click <guibutton>Next</guibutton>.</para>
<para>
  <figure id="fig_visual_cpp6">
    <title>Visual C++ 6.0 installation wizard</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_cpp6.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>If you agree to the license (<xref linkend="fig_visual_c_license" />),
	put the checkmark and click <guibutton>Next</guibutton>.</para>
<para>
  <figure id="fig_visual_c_license">
    <title>Visual C++ license dialog</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_license.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>Enter the registration information in the form (<xref 
linkend="fig_visual_c_product_id" />) and click <guibutton>Next</guibutton>.</para>
<para>
  <figure id="fig_visual_c_product_id">
    <title>Visual C++ product ID dialog</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_product_id.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>When asked for the installation location (<xref 
	linkend="fig_visual_c_install_location" />), choose
	<filename>c:\Program Files\Microsoft Visual Studio\Common</filename> and
	click <guibutton>Next</guibutton>.</para>
<para>
  <figure id="fig_visual_c_install_location">
    <title>Visual C++ installation location</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_install_location.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>To continue with the installation processs (<xref linkend="fig_visual_c_setup" />),
 click <guibutton>Next</guibutton></para>
<para>
  <figure id="fig_visual_c_setup">
    <title>Visual C++ standard setup</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_setup.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>Note down the Product ID (<xref linkend="fig_visual_c_product_information" />)
 and click <guibutton>OK</guibutton>.</para>
<para>
  <figure id="fig_visual_c_product_information">
    <title></title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_product_information.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>When asked for the setup type (<xref linkend="fig_visual_c_components" />),
 click on the <guibutton>Standard</guibutton> button.</para>
<para>
  <figure id="fig_visual_c_components">
    <title>Visual C++ setup type</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_components.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>When asked to register the environment variables (<xref linkend="fig_visual_c_environment_variables" />),
 you can leave the option to register the environment variables unchecked, though
 it does no harm to check this option. Click <guibutton>OK</guibutton></para>
<para>
  <figure id="fig_visual_c_environment_variables">
    <title>Visual C++ environment variables</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_environment_variables.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>Read the information about the NT debug symbols (<xref linkend="fig_visual_c_nt_debug_symbols" />)
 and click <guibutton>OK</guibutton>.</para>
<para>
  <figure id="fig_visual_c_nt_debug_symbols">
    <title>NT debug symbols</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_nt_debug_symbols.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>Note that the Visual C++ setup has finished successfully (<xref linkend="fig_visual_c_installation_successful" />)
 and click <guibutton>OK</guibutton>.</para>
<para>
  <figure id="fig_visual_c_installation_successful">
    <title>Visual C++ setup success</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_installation_successful.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
</sect3>
<sect3 id="install_msdn">
  <title>Install MSDN Library</title>
<para>Start the MSDN setup (<xref linkend="fig_msdn_install" />) and
 verify that the option to install MSDN is checked. Click <guibutton>Next</guibutton>.</para>
<para>
  <figure id="fig_msdn_install">
    <title>MSDN Library setup dialog</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/msdn_install.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>Enter the path of your CD-DROM drive (<xref linkend="fig_msdn_cd1" />) and
  click <guibutton>OK</guibutton>.</para>
<para>
  <figure id="fig_msdn_cd1">
    <title>CD-ROM drive selection</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/msdn_cd1.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>If you agree to the license terms (<xref linkend="fig_msdn_setup" />),
  click <guibutton>Next</guibutton>.</para>
<para>
  <figure id="fig_msdn_setup">
    <title>MSDN Library setup</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/msdn_setup.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>Note down the Product ID shown in <xref linkend="fig_msdn_product_id" />
  for future reference and click <guibutton>OK</guibutton>.</para>
<para>
  <figure id="fig_msdn_product_id">
    <title>MSDN Library Product ID</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/msdn_product_id.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>If you agree to the license terms (<xref linkend="fig_msdn_license" />),
	 click <guibutton>I agree</guibutton>.</para>
<para>
  <figure id="fig_msdn_license">
    <title>License terms</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/msdn_license.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>When asked for the installation type (<xref linkend="fig_msdn_components" />),
  click on <guibutton>Standard</guibutton>.</para>
<para>
  <figure id="fig_msdn_components">
    <title>MSDN Library installation type</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/msdn_components.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>When the MSDN Library setup is complete (<xref linkend="fig_msdn_complete" />),
  click <guibutton>OK</guibutton>.</para>
<para>
  <figure id="fig_msdn_complete">
    <title>MSDN Library setup complete</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/msdn_complete.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>You may register your Visual C++ copy online (<xref linkend="fig_visual_c_registration" />).
  Click <guibutton>Finish</guibutton> to leave the installation wizard.</para>
<para>
  <figure id="fig_visual_c_registration">
    <title>Visual C++ registration</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_registration.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
</sect3>
<sect3 id="install_msvc_service_pack">
	<title>Install Visual Studio 6 Service Pack 6</title>
<para>Download Visual Studio 6 Service Pack 6 can be downloaded from
  <ulink url="http://msdn2.microsoft.com/en-us/vstudio/Aa718364.aspx">http://msdn2.microsoft.com/en-us/vstudio/Aa718364.aspx</ulink>.</para>
<para>Start the Visual Studio 6 Service Pack 6 setup.</para>
<para>When asked for a location to place the extracted files (<xref linkend="fig_visual_c_sp6_extract_location" />),
  specify a temporary folder, e.g. <filename>c:\tmp</filename>. Click <guibutton>OK></guibutton>.</para>
<para>
  <figure id="fig_visual_c_sp6_extract_location">
    <title>Temporary files location</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_sp6_extract_location.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>When asked if the temporary folder should be created (<xref linkend="fig_visual_c_sp6_create_folder" />),
  click <guibutton>Yes</guibutton>.</para>
<para>
  <figure id="fig_visual_c_sp6_create_folder">
    <title>Temporary folder creation</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_sp6_create_folder.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>Start the Visual Studio 6.0 Service Pack 6 setup (<xref linkend="fig_visual_c_sp6_welcome" />)
  from the temporary folder and click <guibutton>Continue</guibutton>.</para>
<para>
  <figure id="fig_visual_c_sp6_welcome">
    <title>Visual Studio 6.0 Service Pack 6 welcome page</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_sp6_welcome.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>If you agree to the Visual Studio 6.0 Service Pack 6 license agreement (<xref linkend="fig_visual_c_sp6_eula" />),
  click <guibutton>I Agree</guibutton>.</para>
<para>
  <figure id="fig_visual_c_sp6_eula">
    <title>Visual Studio 6.0 Service Pack 6 License Agreement</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_sp6_eula.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
<para>When asked for a Windows reboot (<xref linkend="fig_visual_c_sp6_reboot" />),
  click <guibutton>Windows reboot</guibutton>.</para>
<para>
  <figure id="fig_visual_c_sp6_reboot">
    <title>Windows reboot</title>
    <mediaobject>
      <imageobject>
        <imagedata format="PNG" fileref="figure/visual_c_sp6_reboot.png" />
      </imageobject>
    </mediaobject>
  </figure>
</para>
</sect3>

<sect3 id="install_gtk_devel_environment">
	<title>Install the GTK+ All-in-one-bundle</title>
<para>The GTK+ All-in-one bundle should be used and can be downloaded from 
	<ulink url="http://sourceforge.net/projects/dia-installer/files/gtk%2B/2.24.10/gtk%2B-bundle_2.24.10-20120208_win32_pixbuf.loaders.zip/download"
	>Sourceforge</ulink>.</para>
<para>Unzip the contents of the folder to <filename>C:\GTK</filename>.</para>
<para>Copy <filename>c:\gtk\bin\intl.dll</filename> to <filename>c:\gtk\bin\libintl.dll</filename>.</para>
</sect3>

<sect3 id="install_iconv">
	<title>Install iconv</title>
	<para>While glib includes its own copy of iconv, libxml2 requires a separate
		iconv installation.</para>
	<para>The libxml2 iconv version can be downloaded from 
	<ulink url="http://www.zlatkovic.com/libxml.en.html"
		>http://www.zlatkovic.com/libxml.en.html</ulink>.</para>
	<para>Unzip the file and copy the contents of the <filename
	>iconv-1.9.2.win32</filename> folder to <filename>C:\GTK</filename>.</para>
</sect3>
<sect3 id="install_libxml">
	<title>Install libxml2</title>
	<para>Download libxml2 from <ulink url="http://www.zlatkovic.com/libxml.en.html"
	>http://www.zlatkovic.com/libxml.en.html</ulink>.</para>
	<para>Unzip the file and copy the contents of the 
		<filename>libxml2-2.7.8.win32</filename> folder to 
		<filename>C:\GTK</filename>.</para>
</sect3>
</sect2>
<sect2 id="install_optional_software">
  <title>Installing optional software</title>
  <para>The following software packages are optional, because they can be used
    to create the full Dia for Windows installer, but they are not necessary to
    just build the Dia binaries or compile a plug-in.</para>
    
  <sect3 id="install_libart">
	<title>Install LibArt_LGPL</title>
	<para>LibArt_LGPL is the graphics library used by Dia's libart plugin. 
		It is available from
	  <ulink url="http://ftp.gnome.org/pub/gnome/binaries/win32/libart_lgpl/2.3/"
	  >http://ftp.gnome.org/pub/gnome/binaries/win32/libart_lgpl/2.3/</ulink>.</para>
	<para>Extract the contents of <filename>libart_lgpl-2.3.21-1_win32.zip</filename>
	  and <filename> libart_lgpl-dev-2.3.21-1_win32.zip</filename> to <filename>c:\gtk</filename>.</para>      
	<para>In case you don't want to compile the libart plugin, comment it out
		in plug-ins/makefile.msc.</para>
	<para>Use the following script to create <filename>libart_lgpl_2-2.lib</filename>:</para>
	<programlisting>
dumpbin /exports c:\gtk\bin\libart_lgpl_2-2.dll > c:\gtk\lib\libart_lgpl_2-2.dumpbin
echo EXPORTS > c:\gtk\lib\libart_lgpl_2-2.def
sed -n "/RVA/,/Summary/p" c:\gtk\lib\libart_lgpl_2-2.dumpbin | sed -n "/[0-9]/p" | sed "s/.* //" >> c:\gtk\lib\libart_lgpl_2-2.def
lib /def:c:\gtk\lib\libart_lgpl_2-2.def /out:c:\gtk\lib\libart_lgpl_2-2.lib /machine:x86
</programlisting>
	</sect3>  
  <sect3 id="install_nsis">
    <title>NSIS</title>
    <para>NSIS is used to build the Dia installer.</para>
  </sect3>
  <sect3 id="install_python">
    <title>Install Python 2.3</title>
    <para>If you intend to build the Python plug-in, install Python 2.3 to 
      <filename>c:\python23</filename>.</para>
    <para>Newer Python versions are not build against <filename
      >msvcrt.dll</filename> and thus require to rebuild all libraries that
      Dia is linked against. Therefore building Dia with newer Python versions
      is not covered by this document.</para>
    	<para>In case you don't want to compile the Python plugin and language
    	bindings, comment out
	the nmake calls for the <filename>bindings</filename> and 
	<filename>plug-ins\python</filename> folders. Edit 
	<filename>c:\gtk\dia\makefile.msc</filename> as indicated by the comments
	in the file (around lines 58 and 67).</para>  
  </sect3>
  <sect3 id="install_swig">
    <title>Install swig</title>
    <para>The swig command is required to build the Python bindings.</para>
    <para>Download swig from <ulink url="http://www.swig.org"
    	>http://www.swig.org</ulink> and unzip <command>swig.exe</command> and 
    	the <filename>lib</filename> folder to <filename>C:\GTK\bin</filename>.
    	</para>
  </sect3>
  <sect3 id="install_libxslt">
  	<title>Install LibXSLT</title>
  	<para>The LibXSLT library is used by the xslt plugin. Thus you won't be able
  		to build the xslt plugin without LibXSLT.</para>
  	<para>Download libxslt from <ulink url="http://www.zlatkovic.com/libxml.en.html"
	>http://www.zlatkovic.com/libxml.en.html</ulink>.</para>
	<para>Unzip the file and copy the contents of the 
		<filename>libxslt-1.1.26.win32</filename> folder to 
		<filename>C:\GTK</filename>.</para>
	<para>In case you don't want to compile the xslt plugin, comment it out
		in plug-ins/makefile.msc.</para>	
  </sect3>
  <sect3 id="install_librsvg">
  	<title>Install librsvg</title>
  	<para>The librsvg library is used to render SVG images as image objects. Note that
  		librsvg is not used for the SVG import, SVG export or
  		the Dia shapes.</para>
  	<para>Download <filename>librsvg-dev_2.32.1.-1_win32.zip</filename>,
  		<filename>librsvg_2.32.1-1_win32.zip</filename> and 
  		<filename>svg-gdk-pixbuf-loader_2.32.1-1_win32.zip</filename> from 
  		<ulink url="http://ftp.gnome.org/pub/GNOME/binaries/win32/librsvg/2.32/"
  		>http://ftp.gnome.org/pub/GNOME/binaries/win32/librsvg/2.32/</ulink>.</para>
  	<para>Unzip those files and copy the contents to <filename>C:\GTK</filename>.</para>
  </sect3>
</sect2>
<sect2 id="obtain_sources">
  <title>Getting the Dia sources</title>
  <para>Any serious Dia development should use the latest sources from the GNOME
    Git repository: <ulink url="git://git.gnome.org/dia"
    >git://git.gnome.org/</ulink>.</para>
  <para>In case you don't know how to use Git or you don't want to use
    it, you can also use a source tarball from the Dia download pages.</para>
  <important><para>For the instructions of this tutorial to work, the Dia sources
  	 should be located in <filename>c:\gtk\dia</filename>.</para></important>
  <sect3 id="additional_sources">
    <title>Additional sources for the MSVC build</title>
    <para>Download <ulink 
    url="http://downloads.sourceforge.net/dia-installer/dia_extra_src_msvc_2009-11-05.zip"
    >http://downloads.sourceforge.net/dia-installer/dia_extra_src_msvc_2009-11-05.zip</ulink>
    and unzip the contents to <filename>c:\</filename>.</para>
  </sect3>
  <sect3 id="patch">
  	<title>Patch to work around Bug #679417</title>
  	<para>Download and apply the following patch: <ulink url="http://sourceforge.net/projects/dia-installer/files/dia/0.97.2/0001-Bug-679417-Work-around-libpixbufloaders-.dll-install.patch/download">0001-Bug-679417-Work-around-libpixbufloaders-.dll-install.patch</ulink></para>
  </sect3>  
</sect2>
<sect2 id="compilation">
    <title>Compilation</title>
    
<para>Using the Visual C++ 6.0 build environment (<xref linkend="install_msvc" />):
    Starting from <filename class="directory">c:\gtk\dia</filename>, the
    following commands are necessary to compile <command>dia</command>:</para>
    <programlisting>
C:\GTK\bin\diadev.bat
cd \GTK\dia
nmake /f makefile.msc
</programlisting>

  </sect2>

  <sect2 id="running">
    <title>Putting everything together</title>

    <para>In order to run <command>dia</command> sucessfully, the binaries
    	have to be put in the correct file structure.</para>

	<para>Copy an existing Dia for Windows installation to 
		<filename>C:\GTK\dia\build\win32</filename>. Delete the contents of
		<filename>C:\GTK\dia\build\win32\bin</filename> and 
		<filename>C:\GTK\dia\build\win32\dia</filename>. 
		Run the following commands:</para>
	<programlisting>
cd \GTK\dia
nmake /f makefile.msc full
</programlisting>	
    <para>Congratulations, you should now be able to run your copy of
    <command>dia</command> by executing
    <command>C:\GTK\bin\dia</command>.</para>
  </sect2>

  <sect2 id="troubleshooting">
    <title>Troubleshooting</title>

    <sect3 id="debugging">
      <title>Debugging</title>

      <para>In order to enable debugging, run <command>nmake -f makefile.msc
      DEBUG=1</command>.</para>
    </sect3>

    <sect3 id="console_output">
      <title>Console Output</title>

      <para>In order to enable console output, use <command>dia.exe</command>,
        not <command>diaw.exe</command>. This allows to see error
      and warning messages produced by dia.</para>
    </sect3>
  </sect2>
<sect2 id="additional_information">
  <title>Additional information</title>

      <para>Make sure to read the information provided by Hans Breuer and Tor
      Lillqvist, in particular the comments in the <link
      linkend="build_files">build files</link> and the files named *.win32 in
      the glib, GTK+ and dia sources.</para>

      <para>The archives of the dia and gimpwin-dev mailing lists may contain
      useful information.</para>

      <para>If none of the above sources contain information to solve your
      problem, contact the author of this document: Steffen Macke
      <email>sdteffen@gmail.com</email></para>


    <sect3 id="compiler">
      <title>Compiler</title>

      <para>The MS Visual C++ compiler is used to compile dia for win32.
      Versions 5, 6 have been used successfully. The compiler is invoked using
      the <command>cl</command> command.</para>

      <caution>
        <para>When compiling with Visual C++ version 7, you'll have to
        recompile all libraries as you'll have to link against
        <filename>msvcrt7.dll</filename> instead of
        <filename>msvcrt.dll</filename>. This applies to all GTK+ libraries
        which you'll have to rebuild on your own.</para>
        <para>This also applies to newer Visual C++ versions.</para>
      </caution>

      <para>Compiling Dia for Windows with <command>gcc</command> from the MinGW
      distribution should be possible. However, compilation with
      <command>gcc</command> is not covered in this document. Make sure to
      check Dia's bugzilla for MinGW-related patches.</para>
    </sect3>

    <sect3 id="make">
      <title>Make</title>

      <para>The makefiles work with MS <command>nmake</command>. The
      <command>nmake</command> tool comes with MS Visual Studio.</para>
    </sect3>

    <sect3 id="command_line_interpreter">
      <title>Command line interpreter</title>

      <para>The standard MS command line interpreter
      <command>cmd.exe</command> is used to compile dia.</para>
    </sect3>
    
     <sect3 id="build_files">
      <title>Build Files</title>

      <para>With the setup mentioned above, you should be able to compile
      <command>dia</command> out of the box. However, you should know which
      files control the build process. In addition to the various
      <filename>makefile.msc</filename>'s that are introduced below, there are
      two important files: <itemizedlist>
          <listitem>
            <para><filename>$TOP\glib\build\win32\make.msc</filename>,
            included by <filename>makefile.msc</filename></para>
          </listitem>

          <listitem>
            <para><filename>$TOP\glib\build\win32\module.defs</filename>,
            included by <filename>make.msc</filename></para>
          </listitem>
        </itemizedlist></para>

      <para>If you're working with updated versions of some of the libraries
      you may have to edit these files.</para>
    </sect3>
</sect2>
<sect2 id="cairo">
    <title>Updated cairo version</title>
    <para>The cairo DLL (version 1.10.2) included in the GTK+ all-in-one bundle
	2.24.10 has some bugs. See e.g. 
	<ulink url="https://bugzilla.gnome.org/show_bug.cgi?id=679651">bug #679651</ulink>.
	An updated cairo DLL (e.g. version 1.12.16) can be build using the 
	<ulink url="https://build.opensuse.org/package/show/home:sdteffen_de:branches:windows:mingw:win32/mingw32-cairo">openSUSE Build Service</ulink>.
	You can branch the package to start your own development. When doing so,
	remember to add the windows:mingw:win32 repository via the advanced
	interface. This is necessary in order to locate libraries on which cairo
	depends. 
    </para>
</sect2>
</sect1>
<sect1 id="ubuntu">
	<title>Ubuntu</title>
	<para>Starting from a vanilla Ubuntu 12.04 deskop installation, you can install the necessary packages using
	the following command:</para>
	<programlisting>
sudo apt-get install autoconf automake autotools-dev git git-core gsfonts-x11 \
intltool libatk1.0-dev libcairo-gobject2 libcairo2-dev liberror-perl \
libexpat1-dev libfontconfig1-dev libfreetype6-dev libgdiplus \
libgdk-pixbuf2.0-dev libgif4 libglib2.0-bin libglib2.0-dev \
libgtk2.0-dev libice-dev libltdl-dev libmono-accessibility2.0-cil \
libmono-data-tds2.0-cil libmono-messaging2.0-cil libmono-sqlite2.0-cil \
libmono-system-data2.0-cil libmono-system-messaging2.0-cil \
libmono-system-web2.0-cil libmono-wcf3.0-cil \
libmono-winforms2.0-cil libmono2.0-cil libpango1.0-dev libpixman-1-dev \
libpng12-dev libpthread-stubs0 libpthread-stubs0-dev libsm-dev libsqlite0 \
libssl-dev libtool libx11-dev libxau-dev libxcb-render0-dev libxcb-shm0-dev \
libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev \
libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxml2-dev \
libxrandr-dev libxrender-dev m4 python-sip python2.7-dev swig \
x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev \
x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev \
x11proto-xext-dev x11proto-xinerama-dev xtrans-dev zlib1g-dev libart-2.0-dev</programlisting>
</sect1>
	<para>Clone the git repository, for example:</para>
	<programlisting>git clone git://git.gnome.org/dia</programlisting>
	<para>Enter the dia directory and start the build process using the
		following commands:</para>
	<programlisting>cd dia
./autogen.sh
./configure --prefix=/usr --with-python --with-swig --with-libart
make
</programlisting>
	<para>To install, run the following command:</para>
	<programlisting>make install</programlisting>
<sect1 id="macosx">
	<title>Mac OS X</title>
	<para><ulink url="http://www.macports.org/">MacPorts</ulink> can be used to compile Dia for Mac OS X. A readymade 
		<ulink url="http://trac.macports.org/browser/trunk/dports/gnome/dia/Portfile">Portfile</ulink> is available.
		The MacPorts documentation is great and contains everything you need to build Dia on your Mac.</para>
	<para>When compiling 32-bit on a 64-bit-capable CPU, remember to set build_arch to i386 in macports.conf before
		the installation of any ports.</para>
	<para>Sign the App bundle:</para>
	<programlisting>codesign -s "Developer ID Application" Dia.app</programlisting>	
</sect1>
</article>
