LinkShare rotating banner
Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

Wednesday, September 5, 2012

Compiling CMake with MinGW

CMake is a portable build system. CMake can be used to replace the traditional GNU build process, as in:



./configure

make

make install


Compiling CMake is fairly simple. After you install MinGW (as shown in this post), download and unpack the CMake source tarball. Run the following commands in order.



tar xzvf cmake-2.8.9.tar.gz
cd cmake-2.8.9
./bootstrap --prefix=/mingw
make
make install

Sunday, September 2, 2012

Setting Up Cygwin For C/C++ Software Development on Windows

Cygwin provides a Unix-like environment for Windows users. Cygwin is useful for people who want to learn Unix or popular Linux without having to install Unix or Linux. Cygwin can also be used to port Linux applications to Windows or develop genuine Windows applications. To install Cygwin, download setup.exe from the Cygwin website and run it.



Cygwin Packages for Software Development


In addition to the default packages, select the following packages for common development environment:


  • bison
  • gettext-devel
  • libtool
  • make
  • patch
  • pkg-config


To select a package for installation, type the name of the package in the Search box, expand the categories by clicking a plus, and clicking on the package until its version number shows up.



cygwin_setup_mingw64

If you want to develop software applications that depend on cygwin1.dll (which emulates Unix on Windows), install one of the following packages. This is when you want to port Linux applications to Windows with little modification.


  • gcc-g++

    outdated version 3.4.4
  • gcc4-g++

    GCC 4.x that links applications with cygwin1.dll


If you want to develop pure Windows applications, install one of the following packages.


  • mingw-gcc-g++

    The original MinGW compiler from mingw.org can't build 64-bit applications.
  • mingw64-i686-gcc-g++

    New MinGW compiler from mingw-w64.sourceforge.net.
  • mingw64-x86_64-gcc-g++

    Install these to develop 64-bit Windows applications.


When you see the Resolving Dependencies window, just accept and click Next.


cygwin_setup_dependencies

Setting HOME Variable


Setting the environment variable %HOME% is useful for various reasons. First of all, it allows regular users to compile freely in their user folder without requiring access to C:\Cygwin. Secondly, it allows users to save user-specific configuration in their user folder. For example, user configuration files such as .profile, .gtkrc-2.0, .fonts.conf and .pango-aliases can be saved in the folder specified by %HOME%.


Set HOME environment variable for MinGW and Cygwin

Setting Up mingw* compiler for Cygwin


The file C:\Cygwin\etc\fstab is used to set up mount points in Cygwin. If you installed mingw64 packages, open the file C:\Cygwin\etc\fstab in a text editor and append the following line.


/usr/i686-w64-mingw32/sys-root/mingw /mingw none bind

Start the Cygwin terminal and type the following commands to set up Cygwin for Windows compilation.


ln -s /usr/bin/i686-w64-mingw32-g++.exe /usr/i686-w64-mingw32/bin/g++.exe
ln -s /usr/bin/i686-w64-mingw32-gcc.exe /usr/i686-w64-mingw32/bin/gcc.exe

Also, set up some environment variables.


export CFLAGS="-march=pentium2 -mtune=i586 -mthreads -mms-bitfields -O2"
export CXXFLAGS="-march=pentium2 -mtune=i586 -mthreads -mms-bitfields -O2"
export CPPFLAGS="-I/mingw/include"
export LDFLAGS="-L/mingw/lib -Wl,--enable-auto-image-base -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc"
export PATH=/mingw/bin:/usr/i686-w64-mingw32/bin:/usr/local/bin:/usr/bin
export PKG_CONFIG_PATH=/mingw/lib/pkgconfig


Setting Up gcc* Compiler for Cygwin


If you installed the gcc4 compiler (as opposed to mingw*), set up some environment variables to customize your build environment. I usually type the following commands:


CC="/usr/bin/gcc.exe"
CFLAGS="-march=pentium2 -mtune=i586 -mthreads -mms-bitfields -O2"
CPPFLAGS="-I/usr/include"
CXXFLAGS="-march=pentium2 -mtune=i586 -mthreads -mms-bitfields -O2"
LDFLAGS="-L/usr/lib -Wl,--enable-auto-image-base -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc"
export CC CFLAGS CPPFLAGS CXXFLAGS LDFLAGS

Friday, June 12, 2009

Packaging, Installing and Configuring GTK+ 2 for Windows

After compiling GTK+ for Windows, we're ready to install and set up GTK+. First, make a Zip archive containing the following files, preserving the directory structure:


bin/charset.dll
bin/cjpeg.exe
bin/djpeg.exe
bin/fc-cache.exe
bin/fc-cat.exe
bin/fc-list.exe
bin/fc-match.exe
bin/gdk-pixbuf-query-loaders.exe
bin/gspawn-win32-helper-console.exe
bin/gspawn-win32-helper.exe
bin/gtk-query-immodules-2.0.exe
bin/iconv.dll
bin/iconv.exe
bin/intl.dll
bin/jpegtran.exe
bin/libatk-1.0-0.dll
bin/libcairo-2.dll
bin/libcharset-1.dll
bin/libexpat-1.dll
bin/libfontconfig-1.dll
bin/libfreetype-6.dll
bin/libgailutil-18.dll
bin/libgdk-win32-2.0-0.dll
bin/libgdk_pixbuf-2.0-0.dll
bin/libgio-2.0-0.dll
bin/libglib-2.0-0.dll
bin/libgmodule-2.0-0.dll
bin/libgobject-2.0-0.dll
bin/libgthread-2.0-0.dll
bin/libgtk-win32-2.0-0.dll
bin/libiconv-2.dll
bin/libintl-8.dll
bin/libjpeg-62.dll
bin/libjpeg-7.dll
bin/libpango-1.0-0.dll
bin/libpangocairo-1.0-0.dll
bin/libpangoft2-1.0-0.dll
bin/libpangowin32-1.0-0.dll
bin/libpixman-1-0.dll
bin/libpng-3.dll
bin/libpng12-0.dll
bin/libtiff-3.dll
bin/libtiffxx-3.dll
bin/libxml2-2.dll
bin/pango-querymodules.exe
bin/rdjpgcom.exe
bin/wrjpgcom.exe
bin/xmlwf.exe
bin/zlib1.dll
etc/fonts/conf.avail/10-autohint.conf
etc/fonts/conf.avail/10-no-sub-pixel.conf
etc/fonts/conf.avail/10-sub-pixel-bgr.conf
etc/fonts/conf.avail/10-sub-pixel-rgb.conf
etc/fonts/conf.avail/10-sub-pixel-vbgr.conf
etc/fonts/conf.avail/10-sub-pixel-vrgb.conf
etc/fonts/conf.avail/10-unhinted.conf
etc/fonts/conf.avail/20-fix-globaladvance.conf
etc/fonts/conf.avail/20-unhint-small-vera.conf
etc/fonts/conf.avail/25-unhint-nonlatin.conf
etc/fonts/conf.avail/30-metric-aliases.conf
etc/fonts/conf.avail/30-urw-aliases.conf
etc/fonts/conf.avail/40-nonlatin.conf
etc/fonts/conf.avail/45-latin.conf
etc/fonts/conf.avail/49-sansserif.conf
etc/fonts/conf.avail/50-user.conf
etc/fonts/conf.avail/51-local.conf
etc/fonts/conf.avail/60-latin.conf
etc/fonts/conf.avail/65-fonts-persian.conf
etc/fonts/conf.avail/65-khmer.conf
etc/fonts/conf.avail/65-nonlatin.conf
etc/fonts/conf.avail/69-unifont.conf
etc/fonts/conf.avail/70-no-bitmaps.conf
etc/fonts/conf.avail/70-yes-bitmaps.conf
etc/fonts/conf.avail/80-delicious.conf
etc/fonts/conf.avail/90-synthetic.conf
etc/fonts/conf.d/20-fix-globaladvance.conf
etc/fonts/conf.d/20-unhint-small-vera.conf
etc/fonts/conf.d/30-metric-aliases.conf
etc/fonts/conf.d/30-urw-aliases.conf
etc/fonts/conf.d/40-nonlatin.conf
etc/fonts/conf.d/45-latin.conf
etc/fonts/conf.d/49-sansserif.conf
etc/fonts/conf.d/50-user.conf
etc/fonts/conf.d/51-local.conf
etc/fonts/conf.d/60-latin.conf
etc/fonts/conf.d/65-fonts-persian.conf
etc/fonts/conf.d/65-nonlatin.conf
etc/fonts/conf.d/69-unifont.conf
etc/fonts/conf.d/80-delicious.conf
etc/fonts/conf.d/90-synthetic.conf
etc/fonts/conf.d/README
etc/fonts/fonts.conf
etc/fonts/fonts.dtd
etc/gtk-2.0/gdk-pixbuf.loaders
etc/gtk-2.0/gtk.immodules
etc/gtk-2.0/gtkrc
etc/gtk-2.0/im-multipress.conf
etc/pango/pango.modules
lib/charset.alias
lib/gtk-2.0/2.10.0/engines/libpixmap.dll
lib/gtk-2.0/2.10.0/engines/libwimp.dll
lib/gtk-2.0/2.10.0/immodules/im-am-et.dll
lib/gtk-2.0/2.10.0/immodules/im-cedilla.dll
lib/gtk-2.0/2.10.0/immodules/im-cyrillic-translit.dll
lib/gtk-2.0/2.10.0/immodules/im-inuktitut.dll
lib/gtk-2.0/2.10.0/immodules/im-ipa.dll
lib/gtk-2.0/2.10.0/immodules/im-multipress.dll
lib/gtk-2.0/2.10.0/immodules/im-thai.dll
lib/gtk-2.0/2.10.0/immodules/im-ti-er.dll
lib/gtk-2.0/2.10.0/immodules/im-ti-et.dll
lib/gtk-2.0/2.10.0/immodules/im-viqr.dll
lib/gtk-2.0/modules/libgail.dll
lib/locale/af/LC_MESSAGES/atk10.mo
lib/locale/af/LC_MESSAGES/gtk20-properties.mo
lib/locale/af/LC_MESSAGES/gtk20.mo
lib/locale/am/LC_MESSAGES/atk10.mo
lib/locale/am/LC_MESSAGES/glib20.mo
lib/locale/am/LC_MESSAGES/gtk20-properties.mo
lib/locale/am/LC_MESSAGES/gtk20.mo
lib/locale/ang/LC_MESSAGES/gtk20-properties.mo
lib/locale/ang/LC_MESSAGES/gtk20.mo
lib/locale/ar/LC_MESSAGES/atk10.mo
lib/locale/ar/LC_MESSAGES/glib20.mo
lib/locale/ar/LC_MESSAGES/gtk20-properties.mo
lib/locale/ar/LC_MESSAGES/gtk20.mo
lib/locale/as/LC_MESSAGES/atk10.mo
lib/locale/as/LC_MESSAGES/glib20.mo
lib/locale/as/LC_MESSAGES/gtk20-properties.mo
lib/locale/as/LC_MESSAGES/gtk20.mo
lib/locale/ast/LC_MESSAGES/gtk20-properties.mo
lib/locale/ast/LC_MESSAGES/gtk20.mo
lib/locale/az/LC_MESSAGES/atk10.mo
lib/locale/az/LC_MESSAGES/glib20.mo
lib/locale/az/LC_MESSAGES/gtk20-properties.mo
lib/locale/az/LC_MESSAGES/gtk20.mo
lib/locale/az_IR/LC_MESSAGES/gtk20-properties.mo
lib/locale/az_IR/LC_MESSAGES/gtk20.mo
lib/locale/be/LC_MESSAGES/atk10.mo
lib/locale/be/LC_MESSAGES/glib20.mo
lib/locale/be/LC_MESSAGES/gtk20-properties.mo
lib/locale/be/LC_MESSAGES/gtk20.mo
lib/locale/be@latin/LC_MESSAGES/atk10.mo
lib/locale/be@latin/LC_MESSAGES/glib20.mo
lib/locale/be@latin/LC_MESSAGES/gtk20-properties.mo
lib/locale/be@latin/LC_MESSAGES/gtk20.mo
lib/locale/bg/LC_MESSAGES/atk10.mo
lib/locale/bg/LC_MESSAGES/glib20.mo
lib/locale/bg/LC_MESSAGES/gtk20-properties.mo
lib/locale/bg/LC_MESSAGES/gtk20.mo
lib/locale/bn/LC_MESSAGES/atk10.mo
lib/locale/bn/LC_MESSAGES/glib20.mo
lib/locale/bn/LC_MESSAGES/gtk20-properties.mo
lib/locale/bn/LC_MESSAGES/gtk20.mo
lib/locale/bn_IN/LC_MESSAGES/atk10.mo
lib/locale/bn_IN/LC_MESSAGES/glib20.mo
lib/locale/bn_IN/LC_MESSAGES/gtk20-properties.mo
lib/locale/bn_IN/LC_MESSAGES/gtk20.mo
lib/locale/br/LC_MESSAGES/gtk20-properties.mo
lib/locale/br/LC_MESSAGES/gtk20.mo
lib/locale/bs/LC_MESSAGES/atk10.mo
lib/locale/bs/LC_MESSAGES/glib20.mo
lib/locale/bs/LC_MESSAGES/gtk20-properties.mo
lib/locale/bs/LC_MESSAGES/gtk20.mo
lib/locale/ca/LC_MESSAGES/atk10.mo
lib/locale/ca/LC_MESSAGES/glib20.mo
lib/locale/ca/LC_MESSAGES/gtk20-properties.mo
lib/locale/ca/LC_MESSAGES/gtk20.mo
lib/locale/ca@valencia/LC_MESSAGES/glib20.mo
lib/locale/ca@valencia/LC_MESSAGES/gtk20-properties.mo
lib/locale/ca@valencia/LC_MESSAGES/gtk20.mo
lib/locale/crh/LC_MESSAGES/gtk20-properties.mo
lib/locale/crh/LC_MESSAGES/gtk20.mo
lib/locale/cs/LC_MESSAGES/atk10.mo
lib/locale/cs/LC_MESSAGES/glib20.mo
lib/locale/cs/LC_MESSAGES/gtk20-properties.mo
lib/locale/cs/LC_MESSAGES/gtk20.mo
lib/locale/cy/LC_MESSAGES/atk10.mo
lib/locale/cy/LC_MESSAGES/glib20.mo
lib/locale/cy/LC_MESSAGES/gtk20-properties.mo
lib/locale/cy/LC_MESSAGES/gtk20.mo
lib/locale/da/LC_MESSAGES/atk10.mo
lib/locale/da/LC_MESSAGES/glib20.mo
lib/locale/da/LC_MESSAGES/gtk20-properties.mo
lib/locale/da/LC_MESSAGES/gtk20.mo
lib/locale/de/LC_MESSAGES/atk10.mo
lib/locale/de/LC_MESSAGES/glib20.mo
lib/locale/de/LC_MESSAGES/gtk20-properties.mo
lib/locale/de/LC_MESSAGES/gtk20.mo
lib/locale/dz/LC_MESSAGES/atk10.mo
lib/locale/dz/LC_MESSAGES/glib20.mo
lib/locale/dz/LC_MESSAGES/gtk20-properties.mo
lib/locale/dz/LC_MESSAGES/gtk20.mo
lib/locale/el/LC_MESSAGES/atk10.mo
lib/locale/el/LC_MESSAGES/glib20.mo
lib/locale/el/LC_MESSAGES/gtk20-properties.mo
lib/locale/el/LC_MESSAGES/gtk20.mo
lib/locale/en_CA/LC_MESSAGES/atk10.mo
lib/locale/en_CA/LC_MESSAGES/glib20.mo
lib/locale/en_CA/LC_MESSAGES/gtk20-properties.mo
lib/locale/en_CA/LC_MESSAGES/gtk20.mo
lib/locale/en_GB/LC_MESSAGES/atk10.mo
lib/locale/en_GB/LC_MESSAGES/glib20.mo
lib/locale/en_GB/LC_MESSAGES/gtk20-properties.mo
lib/locale/en_GB/LC_MESSAGES/gtk20.mo
lib/locale/eo/LC_MESSAGES/atk10.mo
lib/locale/eo/LC_MESSAGES/glib20.mo
lib/locale/eo/LC_MESSAGES/gtk20-properties.mo
lib/locale/eo/LC_MESSAGES/gtk20.mo
lib/locale/es/LC_MESSAGES/atk10.mo
lib/locale/es/LC_MESSAGES/glib20.mo
lib/locale/es/LC_MESSAGES/gtk20-properties.mo
lib/locale/es/LC_MESSAGES/gtk20.mo
lib/locale/et/LC_MESSAGES/atk10.mo
lib/locale/et/LC_MESSAGES/glib20.mo
lib/locale/et/LC_MESSAGES/gtk20-properties.mo
lib/locale/et/LC_MESSAGES/gtk20.mo
lib/locale/eu/LC_MESSAGES/atk10.mo
lib/locale/eu/LC_MESSAGES/glib20.mo
lib/locale/eu/LC_MESSAGES/gtk20-properties.mo
lib/locale/eu/LC_MESSAGES/gtk20.mo
lib/locale/fa/LC_MESSAGES/atk10.mo
lib/locale/fa/LC_MESSAGES/glib20.mo
lib/locale/fa/LC_MESSAGES/gtk20-properties.mo
lib/locale/fa/LC_MESSAGES/gtk20.mo
lib/locale/fi/LC_MESSAGES/atk10.mo
lib/locale/fi/LC_MESSAGES/glib20.mo
lib/locale/fi/LC_MESSAGES/gtk20-properties.mo
lib/locale/fi/LC_MESSAGES/gtk20.mo
lib/locale/fr/LC_MESSAGES/atk10.mo
lib/locale/fr/LC_MESSAGES/glib20.mo
lib/locale/fr/LC_MESSAGES/gtk20-properties.mo
lib/locale/fr/LC_MESSAGES/gtk20.mo
lib/locale/ga/LC_MESSAGES/atk10.mo
lib/locale/ga/LC_MESSAGES/glib20.mo
lib/locale/ga/LC_MESSAGES/gtk20-properties.mo
lib/locale/ga/LC_MESSAGES/gtk20.mo
lib/locale/gl/LC_MESSAGES/atk10.mo
lib/locale/gl/LC_MESSAGES/glib20.mo
lib/locale/gl/LC_MESSAGES/gtk20-properties.mo
lib/locale/gl/LC_MESSAGES/gtk20.mo
lib/locale/gu/LC_MESSAGES/atk10.mo
lib/locale/gu/LC_MESSAGES/glib20.mo
lib/locale/gu/LC_MESSAGES/gtk20-properties.mo
lib/locale/gu/LC_MESSAGES/gtk20.mo
lib/locale/he/LC_MESSAGES/atk10.mo
lib/locale/he/LC_MESSAGES/glib20.mo
lib/locale/he/LC_MESSAGES/gtk20-properties.mo
lib/locale/he/LC_MESSAGES/gtk20.mo
lib/locale/hi/LC_MESSAGES/atk10.mo
lib/locale/hi/LC_MESSAGES/glib20.mo
lib/locale/hi/LC_MESSAGES/gtk20-properties.mo
lib/locale/hi/LC_MESSAGES/gtk20.mo
lib/locale/hr/LC_MESSAGES/atk10.mo
lib/locale/hr/LC_MESSAGES/glib20.mo
lib/locale/hr/LC_MESSAGES/gtk20-properties.mo
lib/locale/hr/LC_MESSAGES/gtk20.mo
lib/locale/hu/LC_MESSAGES/atk10.mo
lib/locale/hu/LC_MESSAGES/glib20.mo
lib/locale/hu/LC_MESSAGES/gtk20-properties.mo
lib/locale/hu/LC_MESSAGES/gtk20.mo
lib/locale/hy/LC_MESSAGES/glib20.mo
lib/locale/hy/LC_MESSAGES/gtk20-properties.mo
lib/locale/hy/LC_MESSAGES/gtk20.mo
lib/locale/ia/LC_MESSAGES/gtk20-properties.mo
lib/locale/ia/LC_MESSAGES/gtk20.mo
lib/locale/id/LC_MESSAGES/atk10.mo
lib/locale/id/LC_MESSAGES/glib20.mo
lib/locale/id/LC_MESSAGES/gtk20-properties.mo
lib/locale/id/LC_MESSAGES/gtk20.mo
lib/locale/io/LC_MESSAGES/gtk20-properties.mo
lib/locale/io/LC_MESSAGES/gtk20.mo
lib/locale/is/LC_MESSAGES/atk10.mo
lib/locale/is/LC_MESSAGES/glib20.mo
lib/locale/is/LC_MESSAGES/gtk20-properties.mo
lib/locale/is/LC_MESSAGES/gtk20.mo
lib/locale/it/LC_MESSAGES/atk10.mo
lib/locale/it/LC_MESSAGES/glib20.mo
lib/locale/it/LC_MESSAGES/gtk20-properties.mo
lib/locale/it/LC_MESSAGES/gtk20.mo
lib/locale/ja/LC_MESSAGES/atk10.mo
lib/locale/ja/LC_MESSAGES/glib20.mo
lib/locale/ja/LC_MESSAGES/gtk20-properties.mo
lib/locale/ja/LC_MESSAGES/gtk20.mo
lib/locale/ka/LC_MESSAGES/atk10.mo
lib/locale/ka/LC_MESSAGES/glib20.mo
lib/locale/ka/LC_MESSAGES/gtk20-properties.mo
lib/locale/ka/LC_MESSAGES/gtk20.mo
lib/locale/kn/LC_MESSAGES/atk10.mo
lib/locale/kn/LC_MESSAGES/glib20.mo
lib/locale/kn/LC_MESSAGES/gtk20-properties.mo
lib/locale/kn/LC_MESSAGES/gtk20.mo
lib/locale/ko/LC_MESSAGES/atk10.mo
lib/locale/ko/LC_MESSAGES/glib20.mo
lib/locale/ko/LC_MESSAGES/gtk20-properties.mo
lib/locale/ko/LC_MESSAGES/gtk20.mo
lib/locale/ku/LC_MESSAGES/atk10.mo
lib/locale/ku/LC_MESSAGES/glib20.mo
lib/locale/ku/LC_MESSAGES/gtk20-properties.mo
lib/locale/ku/LC_MESSAGES/gtk20.mo
lib/locale/li/LC_MESSAGES/atk10.mo
lib/locale/li/LC_MESSAGES/gtk20-properties.mo
lib/locale/li/LC_MESSAGES/gtk20.mo
lib/locale/lt/LC_MESSAGES/atk10.mo
lib/locale/lt/LC_MESSAGES/glib20.mo
lib/locale/lt/LC_MESSAGES/gtk20-properties.mo
lib/locale/lt/LC_MESSAGES/gtk20.mo
lib/locale/lv/LC_MESSAGES/atk10.mo
lib/locale/lv/LC_MESSAGES/glib20.mo
lib/locale/lv/LC_MESSAGES/gtk20-properties.mo
lib/locale/lv/LC_MESSAGES/gtk20.mo
lib/locale/mai/LC_MESSAGES/atk10.mo
lib/locale/mai/LC_MESSAGES/glib20.mo
lib/locale/mai/LC_MESSAGES/gtk20-properties.mo
lib/locale/mai/LC_MESSAGES/gtk20.mo
lib/locale/mg/LC_MESSAGES/glib20.mo
lib/locale/mi/LC_MESSAGES/gtk20-properties.mo
lib/locale/mi/LC_MESSAGES/gtk20.mo
lib/locale/mk/LC_MESSAGES/atk10.mo
lib/locale/mk/LC_MESSAGES/glib20.mo
lib/locale/mk/LC_MESSAGES/gtk20-properties.mo
lib/locale/mk/LC_MESSAGES/gtk20.mo
lib/locale/ml/LC_MESSAGES/atk10.mo
lib/locale/ml/LC_MESSAGES/glib20.mo
lib/locale/ml/LC_MESSAGES/gtk20-properties.mo
lib/locale/ml/LC_MESSAGES/gtk20.mo
lib/locale/mn/LC_MESSAGES/atk10.mo
lib/locale/mn/LC_MESSAGES/glib20.mo
lib/locale/mn/LC_MESSAGES/gtk20-properties.mo
lib/locale/mn/LC_MESSAGES/gtk20.mo
lib/locale/mr/LC_MESSAGES/atk10.mo
lib/locale/mr/LC_MESSAGES/glib20.mo
lib/locale/mr/LC_MESSAGES/gtk20-properties.mo
lib/locale/mr/LC_MESSAGES/gtk20.mo
lib/locale/ms/LC_MESSAGES/atk10.mo
lib/locale/ms/LC_MESSAGES/glib20.mo
lib/locale/ms/LC_MESSAGES/gtk20-properties.mo
lib/locale/ms/LC_MESSAGES/gtk20.mo
lib/locale/nb/LC_MESSAGES/atk10.mo
lib/locale/nb/LC_MESSAGES/glib20.mo
lib/locale/nb/LC_MESSAGES/gtk20-properties.mo
lib/locale/nb/LC_MESSAGES/gtk20.mo
lib/locale/ne/LC_MESSAGES/atk10.mo
lib/locale/ne/LC_MESSAGES/glib20.mo
lib/locale/ne/LC_MESSAGES/gtk20-properties.mo
lib/locale/ne/LC_MESSAGES/gtk20.mo
lib/locale/nl/LC_MESSAGES/atk10.mo
lib/locale/nl/LC_MESSAGES/glib20.mo
lib/locale/nl/LC_MESSAGES/gtk20-properties.mo
lib/locale/nl/LC_MESSAGES/gtk20.mo
lib/locale/nn/LC_MESSAGES/atk10.mo
lib/locale/nn/LC_MESSAGES/glib20.mo
lib/locale/nn/LC_MESSAGES/gtk20-properties.mo
lib/locale/nn/LC_MESSAGES/gtk20.mo
lib/locale/nso/LC_MESSAGES/gtk20-properties.mo
lib/locale/nso/LC_MESSAGES/gtk20.mo
lib/locale/oc/LC_MESSAGES/atk10.mo
lib/locale/oc/LC_MESSAGES/glib20.mo
lib/locale/oc/LC_MESSAGES/gtk20-properties.mo
lib/locale/oc/LC_MESSAGES/gtk20.mo
lib/locale/or/LC_MESSAGES/atk10.mo
lib/locale/or/LC_MESSAGES/glib20.mo
lib/locale/or/LC_MESSAGES/gtk20-properties.mo
lib/locale/or/LC_MESSAGES/gtk20.mo
lib/locale/pa/LC_MESSAGES/atk10.mo
lib/locale/pa/LC_MESSAGES/glib20.mo
lib/locale/pa/LC_MESSAGES/gtk20-properties.mo
lib/locale/pa/LC_MESSAGES/gtk20.mo
lib/locale/pl/LC_MESSAGES/atk10.mo
lib/locale/pl/LC_MESSAGES/glib20.mo
lib/locale/pl/LC_MESSAGES/gtk20-properties.mo
lib/locale/pl/LC_MESSAGES/gtk20.mo
lib/locale/ps/LC_MESSAGES/atk10.mo
lib/locale/ps/LC_MESSAGES/glib20.mo
lib/locale/ps/LC_MESSAGES/gtk20-properties.mo
lib/locale/ps/LC_MESSAGES/gtk20.mo
lib/locale/pt/LC_MESSAGES/atk10.mo
lib/locale/pt/LC_MESSAGES/glib20.mo
lib/locale/pt/LC_MESSAGES/gtk20-properties.mo
lib/locale/pt/LC_MESSAGES/gtk20.mo
lib/locale/pt_BR/LC_MESSAGES/atk10.mo
lib/locale/pt_BR/LC_MESSAGES/glib20.mo
lib/locale/pt_BR/LC_MESSAGES/gtk20-properties.mo
lib/locale/pt_BR/LC_MESSAGES/gtk20.mo
lib/locale/ro/LC_MESSAGES/atk10.mo
lib/locale/ro/LC_MESSAGES/glib20.mo
lib/locale/ro/LC_MESSAGES/gtk20-properties.mo
lib/locale/ro/LC_MESSAGES/gtk20.mo
lib/locale/ru/LC_MESSAGES/atk10.mo
lib/locale/ru/LC_MESSAGES/glib20.mo
lib/locale/ru/LC_MESSAGES/gtk20-properties.mo
lib/locale/ru/LC_MESSAGES/gtk20.mo
lib/locale/rw/LC_MESSAGES/atk10.mo
lib/locale/rw/LC_MESSAGES/glib20.mo
lib/locale/rw/LC_MESSAGES/gtk20-properties.mo
lib/locale/rw/LC_MESSAGES/gtk20.mo
lib/locale/si/LC_MESSAGES/atk10.mo
lib/locale/si/LC_MESSAGES/glib20.mo
lib/locale/si/LC_MESSAGES/gtk20-properties.mo
lib/locale/si/LC_MESSAGES/gtk20.mo
lib/locale/sk/LC_MESSAGES/atk10.mo
lib/locale/sk/LC_MESSAGES/glib20.mo
lib/locale/sk/LC_MESSAGES/gtk20-properties.mo
lib/locale/sk/LC_MESSAGES/gtk20.mo
lib/locale/sl/LC_MESSAGES/atk10.mo
lib/locale/sl/LC_MESSAGES/glib20.mo
lib/locale/sl/LC_MESSAGES/gtk20-properties.mo
lib/locale/sl/LC_MESSAGES/gtk20.mo
lib/locale/sq/LC_MESSAGES/atk10.mo
lib/locale/sq/LC_MESSAGES/glib20.mo
lib/locale/sq/LC_MESSAGES/gtk20-properties.mo
lib/locale/sq/LC_MESSAGES/gtk20.mo
lib/locale/sr/LC_MESSAGES/atk10.mo
lib/locale/sr/LC_MESSAGES/glib20.mo
lib/locale/sr/LC_MESSAGES/gtk20-properties.mo
lib/locale/sr/LC_MESSAGES/gtk20.mo
lib/locale/sr@ije/LC_MESSAGES/atk10.mo
lib/locale/sr@ije/LC_MESSAGES/glib20.mo
lib/locale/sr@ije/LC_MESSAGES/gtk20-properties.mo
lib/locale/sr@ije/LC_MESSAGES/gtk20.mo
lib/locale/sr@latin/LC_MESSAGES/atk10.mo
lib/locale/sr@latin/LC_MESSAGES/glib20.mo
lib/locale/sr@latin/LC_MESSAGES/gtk20-properties.mo
lib/locale/sr@latin/LC_MESSAGES/gtk20.mo
lib/locale/sv/LC_MESSAGES/atk10.mo
lib/locale/sv/LC_MESSAGES/glib20.mo
lib/locale/sv/LC_MESSAGES/gtk20-properties.mo
lib/locale/sv/LC_MESSAGES/gtk20.mo
lib/locale/ta/LC_MESSAGES/atk10.mo
lib/locale/ta/LC_MESSAGES/glib20.mo
lib/locale/ta/LC_MESSAGES/gtk20-properties.mo
lib/locale/ta/LC_MESSAGES/gtk20.mo
lib/locale/te/LC_MESSAGES/atk10.mo
lib/locale/te/LC_MESSAGES/glib20.mo
lib/locale/te/LC_MESSAGES/gtk20-properties.mo
lib/locale/te/LC_MESSAGES/gtk20.mo
lib/locale/th/LC_MESSAGES/atk10.mo
lib/locale/th/LC_MESSAGES/glib20.mo
lib/locale/th/LC_MESSAGES/gtk20-properties.mo
lib/locale/th/LC_MESSAGES/gtk20.mo
lib/locale/tk/LC_MESSAGES/atk10.mo
lib/locale/tk/LC_MESSAGES/gtk20-properties.mo
lib/locale/tk/LC_MESSAGES/gtk20.mo
lib/locale/tl/LC_MESSAGES/glib20.mo
lib/locale/tr/LC_MESSAGES/atk10.mo
lib/locale/tr/LC_MESSAGES/glib20.mo
lib/locale/tr/LC_MESSAGES/gtk20-properties.mo
lib/locale/tr/LC_MESSAGES/gtk20.mo
lib/locale/tt/LC_MESSAGES/atk10.mo
lib/locale/tt/LC_MESSAGES/glib20.mo
lib/locale/tt/LC_MESSAGES/gtk20-properties.mo
lib/locale/tt/LC_MESSAGES/gtk20.mo
lib/locale/ug/LC_MESSAGES/atk10.mo
lib/locale/uk/LC_MESSAGES/atk10.mo
lib/locale/uk/LC_MESSAGES/glib20.mo
lib/locale/uk/LC_MESSAGES/gtk20-properties.mo
lib/locale/uk/LC_MESSAGES/gtk20.mo
lib/locale/ur/LC_MESSAGES/gtk20-properties.mo
lib/locale/ur/LC_MESSAGES/gtk20.mo
lib/locale/uz/LC_MESSAGES/gtk20-properties.mo
lib/locale/uz/LC_MESSAGES/gtk20.mo
lib/locale/uz@cyrillic/LC_MESSAGES/gtk20-properties.mo
lib/locale/uz@cyrillic/LC_MESSAGES/gtk20.mo
lib/locale/vi/LC_MESSAGES/atk10.mo
lib/locale/vi/LC_MESSAGES/glib20.mo
lib/locale/vi/LC_MESSAGES/gtk20-properties.mo
lib/locale/vi/LC_MESSAGES/gtk20.mo
lib/locale/wa/LC_MESSAGES/atk10.mo
lib/locale/wa/LC_MESSAGES/glib20.mo
lib/locale/wa/LC_MESSAGES/gtk20-properties.mo
lib/locale/wa/LC_MESSAGES/gtk20.mo
lib/locale/xh/LC_MESSAGES/atk10.mo
lib/locale/xh/LC_MESSAGES/glib20.mo
lib/locale/xh/LC_MESSAGES/gtk20-properties.mo
lib/locale/xh/LC_MESSAGES/gtk20.mo
lib/locale/yi/LC_MESSAGES/atk10.mo
lib/locale/yi/LC_MESSAGES/glib20.mo
lib/locale/yi/LC_MESSAGES/gtk20-properties.mo
lib/locale/yi/LC_MESSAGES/gtk20.mo
lib/locale/zh_CN/LC_MESSAGES/atk10.mo
lib/locale/zh_CN/LC_MESSAGES/glib20.mo
lib/locale/zh_CN/LC_MESSAGES/gtk20-properties.mo
lib/locale/zh_CN/LC_MESSAGES/gtk20.mo
lib/locale/zh_HK/LC_MESSAGES/atk10.mo
lib/locale/zh_HK/LC_MESSAGES/glib20.mo
lib/locale/zh_HK/LC_MESSAGES/gtk20-properties.mo
lib/locale/zh_HK/LC_MESSAGES/gtk20.mo
lib/locale/zh_TW/LC_MESSAGES/atk10.mo
lib/locale/zh_TW/LC_MESSAGES/glib20.mo
lib/locale/zh_TW/LC_MESSAGES/gtk20-properties.mo
lib/locale/zh_TW/LC_MESSAGES/gtk20.mo
share/locale/*/LC_MESSAGES/atk10.mo
share/locale/*/LC_MESSAGES/glib20.mo
share/locale/*/LC_MESSAGES/gtk20-properties.mo
share/locale/*/LC_MESSAGES/gtk20.mo
share/locale/be/LC_MESSAGES/gettext-runtime.mo
share/locale/ca/LC_MESSAGES/gettext-runtime.mo
share/locale/ca/LC_MESSAGES/libiconv.mo
share/locale/cs/LC_MESSAGES/gettext-runtime.mo
share/locale/da/LC_MESSAGES/gettext-runtime.mo
share/locale/da/LC_MESSAGES/libiconv.mo
share/locale/de/LC_MESSAGES/gettext-runtime.mo
share/locale/de/LC_MESSAGES/libiconv.mo
share/locale/el/LC_MESSAGES/gettext-runtime.mo
share/locale/en@boldquot/LC_MESSAGES/gettext-runtime.mo
share/locale/en@quot/LC_MESSAGES/gettext-runtime.mo
share/locale/eo/LC_MESSAGES/libiconv.mo
share/locale/es/LC_MESSAGES/gettext-runtime.mo
share/locale/es/LC_MESSAGES/libiconv.mo
share/locale/et/LC_MESSAGES/gettext-runtime.mo
share/locale/fi/LC_MESSAGES/gettext-runtime.mo
share/locale/fi/LC_MESSAGES/libiconv.mo
share/locale/fr/LC_MESSAGES/gettext-runtime.mo
share/locale/fr/LC_MESSAGES/libiconv.mo
share/locale/ga/LC_MESSAGES/libiconv.mo
share/locale/gl/LC_MESSAGES/gettext-runtime.mo
share/locale/gl/LC_MESSAGES/libiconv.mo
share/locale/hr/LC_MESSAGES/libiconv.mo
share/locale/hu/LC_MESSAGES/libiconv.mo
share/locale/id/LC_MESSAGES/gettext-runtime.mo
share/locale/id/LC_MESSAGES/libiconv.mo
share/locale/it/LC_MESSAGES/gettext-runtime.mo
share/locale/it/LC_MESSAGES/libiconv.mo
share/locale/ja/LC_MESSAGES/gettext-runtime.mo
share/locale/ko/LC_MESSAGES/gettext-runtime.mo
share/locale/locale.alias
share/locale/nl/LC_MESSAGES/gettext-runtime.mo
share/locale/nn/LC_MESSAGES/gettext-runtime.mo
share/locale/no/LC_MESSAGES/gettext-runtime.mo
share/locale/pl/LC_MESSAGES/gettext-runtime.mo
share/locale/pt/LC_MESSAGES/gettext-runtime.mo
share/locale/pt_BR/LC_MESSAGES/gettext-runtime.mo
share/locale/pt_BR/LC_MESSAGES/libiconv.mo
share/locale/ro/LC_MESSAGES/gettext-runtime.mo
share/locale/ro/LC_MESSAGES/libiconv.mo
share/locale/ru/LC_MESSAGES/gettext-runtime.mo
share/locale/ru/LC_MESSAGES/libiconv.mo
share/locale/sk/LC_MESSAGES/gettext-runtime.mo
share/locale/sk/LC_MESSAGES/libiconv.mo
share/locale/sl/LC_MESSAGES/gettext-runtime.mo
share/locale/sl/LC_MESSAGES/libiconv.mo
share/locale/sr/LC_MESSAGES/gettext-runtime.mo
share/locale/sv/LC_MESSAGES/gettext-runtime.mo
share/locale/sv/LC_MESSAGES/libiconv.mo
share/locale/tr/LC_MESSAGES/gettext-runtime.mo
share/locale/tr/LC_MESSAGES/libiconv.mo
share/locale/uk/LC_MESSAGES/gettext-runtime.mo
share/locale/uk/LC_MESSAGES/libiconv.mo
share/locale/zh_CN/LC_MESSAGES/gettext-runtime.mo
share/locale/zh_TW/LC_MESSAGES/gettext-runtime.mo
share/man/man1/cjpeg.1
share/man/man1/djpeg.1
share/man/man1/envsubst.1
share/man/man1/gettext.1
share/man/man1/glib-genmarshal.1
share/man/man1/glib-gettextize.1
share/man/man1/glib-mkenums.1
share/man/man1/gobject-query.1
share/man/man1/gtester-report.1
share/man/man1/gtester.1
share/man/man1/iconv.1
share/man/man1/jpegtran.1
share/man/man1/ngettext.1
share/man/man1/pango-querymodules.1
share/man/man1/pango-view.1.gz
share/man/man1/rdjpgcom.1
share/man/man1/wrjpgcom.1
share/man/man1/xmlwf.1
share/man/man3/bind_textdomain_codeset.3
share/man/man3/bindtextdomain.3
share/man/man3/dcgettext.3
share/man/man3/dcngettext.3
share/man/man3/dgettext.3
share/man/man3/dngettext.3
share/man/man3/gettext.3
share/man/man3/iconv.3
share/man/man3/iconv_close.3
share/man/man3/iconv_open.3
share/man/man3/libpng.3
share/man/man3/libpngpf.3
share/man/man3/ngettext.3
share/man/man3/textdomain.3
share/man/man5/png.5
share/themes/Default/gtk-2.0-key/gtkrc
share/themes/Emacs/gtk-2.0-key/gtkrc
share/themes/MS-Windows/gtk-2.0/gtkrc
share/themes/Raleigh/gtk-2.0/gtkrc

Unpack the Zip archive to a directory, for example, C:\Program Files\Common Files\GTK. Other possible choices for GTK+ installatioon folder could be:


  • C:\Program Files\Common Files\GTK\2.16.4
  • C:\Program Files\GTK\2.16.4
  • C:\Users\Public\GTK\2.16.4
  • C:\Windows\GTK\2.16.4
  • C:\Windows\System
  • C:\Windows\System\GTK\2.16.4
  • C:\Windows\System32
  • C:\Windows\System32\GTK\2.16.4

Then, add the GTK+ directory to %PATH%, as shown below.



Adding GTK bin to %PATH%


This section assumes that you're using Windows Vista. Open the Start menu, right-click on Computer and choose Properties.


Right-Click on Computer

Click on Advanced system settings on the left side of the window.


Vista_System_Properties

At the System Properties dialog, click on Environment Variables at the bottom. At the Environment Variables dialog, click on New. Create a new user variable, PATH as C:\Program Files\Common Files\GTK\bin;%PATH%:




Vista_Environment_Variables
Vista_New_User_Variable

Vista_LANG_variable


You can also define a variable LANG to localize your GTK applications, for example, fr_FR.UTF-8 for French.



Customizing GTK with .gtkrc-2.0


The default GTK look may not be appealing. To customize GTK look, we use GTK themes. When we compile GTK for Windows, we get two GTK theme engines, libpixmap.dll and libwimp.dll. We are going to use the Wimp theme engine, which best matches Windows look. Create a file .../etc/gtk-2.0/gtkrc for systemwide customizaiton with the following contents. Alternatively, create a file .gtkrc-2.0 in your personal folder, for example, C:\Users\Joe\.gtkrc-2.0 .


gtk-theme-name = "MS-Windows"

style "user-font"
{
font_name="Sans 9"
}
widget_class "*" style "user-font"

This assumes that you have the file libwimp.dll and also a theme directory at .../share/themes/MS-Windows . You can also specify other fonts, such as Serif 10 or Arial Bold Italic 10. Start a GTK application like Pidgin, GIMP or X-Chat and check if it looks good.



Compatibility with Pidgin


If you have compiled GTK on your own following my tutorial but Pidgin installer without GTK+ won't install because it can't find your GTK+, you can use PeaZip to manually extract files from the installer. Remember to move subfolders in $_OUTDIR to the Pidgin top folder. Then, create a shortcut on your Desktop pointing to C:\Program Files\Pidgin\pidgin.exe.


My GTK compilation will work with Pidgin if the following files are copied into the Pidgin directory:


iconv.dll

intl.dll

zlib1.dll

These files are easily found on the Internet (1).



Personalize Fontconfig and Pango


Now that GTK+ is working, you can further personalize it by tweaking Fontconfig and Pango. To fine-tune fontconfig, edit fonts.conf. To tweak Pango, create a file .pango.aliases in your personal folder and edit it.

Friday, June 5, 2009

Building gtk-gnutella for Windows

I built gtk-gnutella for the Windows platform using MinGW. gtk-gnutella is an application that allows you to share files in the gnutella P2P network. Here I show how I built GTK-gnutella step-by-step:




  1. Install MinGW


    First of all, I installed MinGW. GCC 4.4 and higher versions are recommended.



  2. Compile Pthread and Regex (Optional)


    Build pthread and regex as shown in the following posts.




  3. Build GTK+ Library


    Follow the instruction in the following post to compile the whole GTK+ library.




  4. Build GnuTLS (Optional)


    I think GnuTLS is optional but it provides secure communication between gnutella clients. I chose to build GTK-gnutella with gnuTLS features. So I compiled GnuTLS as shown in this post.



  5. Unpack the Source


    Then, I downloaded the gtk-gnutella source and unpacked it in my HOME directory.


    cd $HOME

    tar xjvf gtk-gnutella-0.96.6.tar.bz2

    cd gtk-gnutella-0.96.6


  6. Run the Configure script


    Then, I ran ./Configure. For convenience, I am providing here my config.sh file generated by the Configure script. You can copy this file to your source tree before running the Configure script.


    #!/bin/sh
    #
    # This file was produced by running the Configure script. It holds all the
    # definitions figured out by Configure. Should you modify one of these values,
    # do not forget to propagate your changes by running "Configure -der". You may
    # instead choose to run each of the .SH files by yourself, or "Configure -S".
    #

    # Package name : gtk-gnutella
    # Source directory : .
    # Configuration time: Wed Aug 15 14:50:53 HST 2012
    # Configured by : Ken
    # Target system : mingw32_nt-6.1 a7n8x 1.0.17(0.4832) 2011-04-24 23:39 i686 msys

    : Configure command line arguments.
    config_arg0='./Configure'
    config_args=''
    config_argc=0

    Author=''
    Date=''
    Header=''
    Id='$Id'
    Locker=''
    Log=''
    RCSfile=''
    Revision=''
    Source=''
    State=''
    _a='.a'
    _exe='.exe'
    _o='.o'
    afs='false'
    afsroot='/afs'
    alignbytes='8'
    aphostname=''
    ar='/mingw/bin/ar'
    archlib='/mingw/lib/gtk-gnutella'
    archlibexp='/mingw/lib/gtk-gnutella'
    archname='i686-mingw'
    archobjs=''
    awk='/bin/awk'
    bash=''
    bin='/mingw/bin'
    binexp='/mingw/bin'
    bison='/bin/bison'
    byacc='byacc'
    byteorder='1234'
    c=''
    cat='/bin/cat'
    cc='/mingw/bin/gcc.exe'
    ccflags='-march=pentium2 -mtune=i586 -pipe -Wall -Wshadow -DMINGW32 -D_POSIX'
    ccname='gcc'
    ccversion=''
    cf_by='Ken'
    cf_time='Wed Aug 15 14:50:53 HST 2012'
    charsize='1'
    chgrp='/bin/chgrp'
    chmod='/bin/chmod'
    chown='/bin/chown'
    clocktype='int'
    comm=''
    compress=''
    contains='grep'
    cp='/bin/cp'
    cpio=''
    cpp='/mingw/bin/cpp'
    cpp_quote=''
    cpp_stuff='42'
    cppfilter=''
    cppflags='-march=pentium2 -mtune=i586 -pipe -Wall -Wshadow -DMINGW32 -D_POSIX'
    cpplast='-'
    cppminus='-'
    cpprun='/mingw/bin/gcc.exe -E'
    cppstdin='/mingw/bin/gcc.exe -E'
    csh=''
    d_access='define'
    d_alarm='undef'
    d_arc4random='undef'
    d_archlib='define'
    d_attribut='define'
    d_backtrace='undef'
    d_bcmp='undef'
    d_bcopy='undef'
    d_bfd_lib='undef'
    d_bindtxtcode='define'
    d_bsd='undef'
    d_built_clz='define'
    d_built_ctz='define'
    d_built_popcount='define'
    d_bzero='undef'
    d_can64='define'
    d_closefrom='undef'
    d_const='define'
    d_dbus='undef'
    d_deflate='define'
    d_dev_poll='undef'
    d_dirent_d_type='undef'
    d_dirnamlen=''
    d_dladdr='undef'
    d_dos='undef'
    d_enablenls='define'
    d_end_symbol='define'
    d_eofnblk='define'
    d_epoll='undef'
    d_etext_symbol='undef'
    d_eunice='undef'
    d_fast_assert='undef'
    d_fork='undef'
    d_ftime='undef'
    d_getaddrinfo='define'
    d_geteuid='undef'
    d_gethname='undef'
    d_getifaddrs='undef'
    d_getinvent='undef'
    d_getlogin='undef'
    d_getppid='undef'
    d_gettblsz='define'
    d_gettext='define'
    d_gettimeod='define'
    d_getuid='undef'
    d_glib='define'
    d_gnulibc='undef'
    d_gnutls='define'
    d_gtk='define'
    d_headless='undef'
    d_herror='undef'
    d_hstrerror='undef'
    d_iconv='define'
    d_ieee754='define'
    d_ilp32='define'
    d_ilp64='undef'
    d_index='undef'
    d_inflate='define'
    d_iptos='undef'
    d_ipv6='define'
    d_isascii='define'
    d_kevent_int_udata='undef'
    d_kqueue='undef'
    d_linux='undef'
    d_locale_charset='undef'
    d_lp64='undef'
    d_lstat='undef'
    d_madvise='undef'
    d_memalign='undef'
    d_memcpy='define'
    d_memmove='define'
    d_mempcpy='undef'
    d_mmap='undef'
    d_msghdr_msg_flags='undef'
    d_nanosleep='undef'
    d_nls='define'
    d_official='define'
    d_open3='define'
    d_os2='undef'
    d_pause='undef'
    d_phostname='undef'
    d_poll='undef'
    d_popen='define'
    d_portable='undef'
    d_posix_fadvise='undef'
    d_posix_memalign='undef'
    d_pread='undef'
    d_preadv='undef'
    d_pwage='undef'
    d_pwchange='undef'
    d_pwclass='undef'
    d_pwcomment='undef'
    d_pwexpire='undef'
    d_pwquota='undef'
    d_pwrite='undef'
    d_pwritev='undef'
    d_recvmsg='undef'
    d_regcomp='define'
    d_regparm='define'
    d_remotectrl='undef'
    d_rusage='undef'
    d_sbrk='undef'
    d_sched_yield='undef'
    d_select='define'
    d_sendfile='undef'
    d_setproctitle='undef'
    d_setsid='undef'
    d_sigaction='undef'
    d_sigprocmask='undef'
    d_sigsetjmp='undef'
    d_sockaddr_in_sin_len='undef'
    d_sockaddr_un='undef'
    d_socker_get='undef'
    d_statfs='undef'
    d_statvfs='undef'
    d_strchr='define'
    d_strlcat='undef'
    d_strlcpy='undef'
    d_sync_atomic='define'
    d_sysctl='undef'
    d_system='define'
    d_times='undef'
    d_ttyname='undef'
    d_uctx_mctx='undef'
    d_uctx_mctx_gregs='undef'
    d_uname='undef'
    d_useglib1='undef'
    d_useglib2='define'
    d_usegtk1='undef'
    d_usegtk2='define'
    d_usleep='define'
    d_voidsig='define'
    d_volatile='define'
    d_vsnprintf='define'
    d_waitpid='undef'
    d_windows='define'
    d_xenix='undef'
    date='/bin/date'
    dbuscflags=''
    dbusconfig='false'
    dbusldflags=''
    defvoidused='15'
    direntrytype=''
    eagain='EAGAIN'
    ebcdic='undef'
    echo='/bin/echo'
    egrep='/bin/egrep'
    emacs=''
    enablenls='true'
    eunicefix=':'
    expr='/bin/expr'
    fieldn='3'
    find=''
    firstmakefile=''
    flex=''
    from=':'
    gcc=''
    gccosandvers=''
    gccversion='4'
    glade='glade-2'
    glibcflags='-mms-bitfields -I/mingw/include/glib-2.0 -I/mingw/lib/glib-2.0/include -I/mingw/include'
    glibconfig='pkg-config glib-2.0 gobject-2.0'
    glibldflags='-L/mingw/lib -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lintl '
    glibpackage='glib-2.0 gobject-2.0'
    glibpth='/mingw/lib'
    glibversion='2'
    gmake=''
    gmsgfmt='/mingw/bin/msgfmt'
    gnulibc_version=''
    gnutlscflags=''
    gnutlsconfig='pkg-config gnutls'
    gnutlsldflags='-L/mingw/lib -lgnutls'
    grep='/bin/grep'
    groupcat=':'
    gtkcflags='-mms-bitfields -I/mingw/include/gtk-2.0 -I/mingw/lib/gtk-2.0/include -I/mingw/include/atk-1.0 -I/mingw/include/cairo -I/mingw/include/gdk-pixbuf-2.0 -I/mingw/include/pango-1.0 -I/mingw/include/glib-2.0 -I/mingw/lib/glib-2.0/include -I/mingw/include -I/mingw/include/pixman-1 -I/mingw/include/libpng15'
    gtkconfig='pkg-config gtk+-2.0'
    gtkgversion='0.98.3'
    gtkldflags='-Wl,-luuid -L/mingw/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -latk-1.0 -lpangocairo-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl'
    gtkpackage='gtk+-2.0'
    gtkversion='2'
    gzip=''
    h_fcntl='false'
    h_sysfile='true'
    hint='previous'
    hostcat=':'
    huge=''
    i_alloca='undef'
    i_arpainet='undef'
    i_dirent='define'
    i_dlfcn='undef'
    i_execinfo='undef'
    i_fcntl='undef'
    i_iconv='define'
    i_ifaddrs='undef'
    i_inttypes='define'
    i_invent='undef'
    i_langinfo='undef'
    i_libcharset='define'
    i_libintl='define'
    i_limits='define'
    i_linux_netlink='undef'
    i_linux_rtnetlink='undef'
    i_malloc='define'
    i_math='define'
    i_mswsock='define'
    i_netdb='undef'
    i_netif='undef'
    i_netroute='undef'
    i_niin='undef'
    i_niip='undef'
    i_poll='undef'
    i_pthread='define'
    i_pwd='undef'
    i_regex='define'
    i_sched='define'
    i_stdarg='define'
    i_stdlib='define'
    i_string='define'
    i_sysfile='define'
    i_sysin='undef'
    i_sysmman='undef'
    i_sysmount='undef'
    i_sysparam='define'
    i_syspoll='undef'
    i_sysresrc='undef'
    i_sysselct='undef'
    i_syssendfile='undef'
    i_syssock='undef'
    i_sysstat='define'
    i_sysstatvfs='undef'
    i_syssysctl='undef'
    i_systime='define'
    i_systimeb='define'
    i_systimek='undef'
    i_systimes='undef'
    i_systypes='define'
    i_sysun='undef'
    i_sysutsname='undef'
    i_sysvfs='undef'
    i_syswait='undef'
    i_time='undef'
    i_ucontext='undef'
    i_unistd='define'
    i_varargs='undef'
    i_varhdr='stdarg.h'
    i_winsock2='define'
    i_ws2tcpip='define'
    i_zlib='define'
    ieee754_byteorder='1234'
    ilp='32'
    incpath=''
    inews=''
    install='/bin/install.exe'
    installarchlib='/mingw/lib/gtk-gnutella'
    installbin='/mingw/bin'
    installdir='mkdir -p'
    installmansrc=''
    installprivlib='/mingw/lib/gtk-gnutella'
    intsize='4'
    issymlink=''
    ksh=''
    large=''
    ldflags='-Wl,--enable-auto-image-base -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc'
    less=''
    libc=''
    libnames=''
    libpth='/mingw/lib'
    libs='-liberty -lws2_32 -lpthread -lregex -lz -lintl -liconv -limagehlp -liphlpapi -lpowrprof -lpsapi -lkernel32'
    libscheck=''
    libsdirs=' /mingw/lib'
    libsfiles=' libbfd.a libm.a'
    libsfound=' /mingw/lib/libbfd.a /mingw/lib/libm.a'
    libspath=' /mingw/lib /mingw/lib'
    libswanted='bfd iberty sendfile z resolv iconv m intl dl'
    line=''
    lint=''
    lkflags=''
    ln='/bin/ln'
    lns='ln -s'
    locale='/mingw/share/locale'
    localeexp='/mingw/share/locale'
    locincpth=''
    loclibpth=''
    longsize='4'
    lp=''
    lpr=''
    ls=''
    mail=''
    mailx=''
    make='/bin/make'
    make_set_make='#'
    manext='0'
    mansrc=' '
    mansrcexp=''
    medium=''
    mips_type=''
    mkdep='/c/Users/Ken/Downloads/gtk-gnutella-0.98.3/mkdep'
    mkdir='/bin/mkdir'
    models='none'
    more=''
    msgfmt='/mingw/bin/msgfmt'
    msgmerge='/mingw/bin/msgmerge'
    msgmerge_update='/mingw/bin/msgmerge --update'
    mv='/bin/mv'
    myarchname='i686-mingw'
    mydomain=''
    myhostname='lenovo-a8nvm'
    myuname='mingw32_nt-6.1 a7n8x 1.0.17(0.4832) 2011-04-24 23:39 i686 msys '
    n='-n'
    nawk='/bin/nawk'
    nm='/mingw/bin/nm'
    nm_opt=''
    nm_so_opt=''
    nofile=''
    nroff='nroff'
    o_nonblock=''
    official='true'
    optimize='-O2 -g0'
    orderlib='false'
    osname='mingw'
    osvers='1.0.17'
    package='gtk-gnutella'
    passcat=':'
    perl=''
    pg=''
    phostname='hostname'
    pkgsrc='/home/Ken/Downloads/gtk-gnutella-0.98.3'
    plibpth=''
    pmake=''
    pr=''
    prefix='/mingw'
    prefixexp='/mingw'
    privlib='/mingw/lib/gtk-gnutella'
    privlibexp='/mingw/lib/gtk-gnutella'
    prototype='define'
    ptrsize='4'
    ranlib=':'
    rd_nodata=''
    remotectrl='false'
    rm='/bin/rm'
    rmail=''
    run=''
    runnm='false'
    sed='/bin/sed'
    sendmail=''
    sh='/bin/sh'
    shar=''
    sharpbang='#!'
    shortsize='2'
    shsharp='true'
    sig_count='23'
    sig_name='ZERO NUM1 INT NUM3 ILL NUM5 NUM6 NUM7 FPE NUM9 NUM10 SEGV NUM12 NUM13 NUM14 TERM NUM16 NUM17 NUM18 NUM19 NUM20 BREAK ABRT '
    sig_name_init='"ZERO", "NUM1", "INT", "NUM3", "ILL", "NUM5", "NUM6", "NUM7", "FPE", "NUM9", "NUM10", "SEGV", "NUM12", "NUM13", "NUM14", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "NUM20", "BREAK", "ABRT", 0'
    sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 '
    sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0'
    sig_size='23'
    signal_t='void'
    sleep=''
    smail=''
    small=''
    so='dll'
    sockercflags=''
    sockerldflags=''
    sort='/bin/sort'
    spackage='Gtk-gnutella'
    spitshell='cat'
    split=''
    src='.'
    startsh='#!/bin/sh'
    strings='/mingw/include/string.h'
    submit=''
    sysman='/mingw/share/man'
    tablesize='NOFILE'
    tail=''
    tar=''
    targetarch=''
    tbl=''
    tee=''
    test='test'
    timeincl='/mingw/include/sys/time.h '
    to=':'
    touch='/bin/touch'
    tr='/bin/tr'
    trnl='\n'
    troff=''
    uname='/bin/uname'
    uniq='/bin/uniq'
    usecrosscompile='undef'
    usenm='false'
    usrinc='/mingw/include'
    uuname=''
    vi=''
    voidflags='15'
    wc='/bin/wc'
    xgettext='/mingw/bin/xgettext'
    xlibpth='/mingw/lib'
    yacc='bison -y'
    yaccflags=''
    zcat=''
    zip=''
    CONFIG=true

    Alternatively, if your config.sh needs no modification, just run the following commands.


    ./Configure -S
    make depend


  7. Before running make, open src/Makefile and insert -mwindows into the gtk-gnutella section:

  8. gtk-gnutella:  $(OBJ) $(EXTRA)
    $(RM) $@
    if test -f $@$(_EXE); then \
    $(MV) $@$(_EXE) $@~$(_EXE); fi
    $(CC) -o $@ $(OBJ) $(EXTRA) -mwindows $(JLDFLAGS) $(LIBS)

    This prevents GTK-gnutella from outputting error logs to a black console window.



  9. Then, I compiled gtk-gnutella with the following commands:


    make

    make install




gtk-gnutella_winnt

Monday, January 26, 2009

Installing MinGW on Windows

MinGW is a free software development system for Windows. Not only is MinGW useful for porting Linux software to Windows, but you can also use MinGW to write native Windows programs. The following is an excerpt from the MinGW web site:


MinGW: A collection of freely available and freely distributable Windows specific header files and import libraries, augmenting the GNU Compiler Collection (GCC) and its associated tools (GNU binutils). MinGW provides a complete Open Source programming tool set which is suitable for the development of native Windows programs that do not depend on any 3rd-party C runtime DLLs.

Now, let's install MinGW. Note that MinGW doesn't run smoothly on Windows Vista because of weird filesystem restrictions. The workaround is:




  • to install MinGW in your home folder (C:\Users\username) or a public folder (somewhere in C:\Users\Public, for example, C:\Users\Public\Desktop)
  • to run MSYS (rxvt) as administrator (Right-click and select Run as administrator)
  • to install MinGW on FAT filesystem,
  • to work in the safe mode, or
  • to use MinGW Portable which is said to be working well.


To Set up the Latest MinGW


To have a functional MinGW installation, just download and run the latest MinGW installer.





To Set up GCC toolchain 3.4.5


To install the outdated GCC toolchain 3.4.5, download the following installers and run them in the order:




After Installation


After successfully installing MSYS, check the file /etc/fstab inside the MSYS folder. Mine looks like:


C:/MinGW /mingw
C:/MinGW /usr/local


You can try MSYS by double-clicking the MSYS icon on the desktop. This will bring up a console window where you can type in some UNIX commands. For example, the following command will display the version of installed GCC compiler:


$ gcc --version
gcc.exe (GCC) 3.4.5 (mingw-vista special r3)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


The environment variable HOME can be used to set the user's working directory. If your username has a space or foreign character, it may confuse MinGW and hinder the compile process. In Windows Vista and Windows 7, access restriction is imposed outside C:\Users. In such cases, set $HOME to some other location. For example, set the HOME variable like this:




Don't forget to create ~/.profile. This file can be used to set environment variables, such as CC, CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS. These environment variables are used to customize the compiler settings. The following is my .profile contents:


CC=/mingw/bin/gcc.exe
CFLAGS='-march=pentium2 -mtune=i586 -mthreads -mms-bitfields -O2'
CXXFLAGS='-march=pentium2 -mtune=i586 -mthreads -mms-bitfields -O2'
LDFLAGS='-Wl,--enable-auto-image-base,--enable-auto-import,--enable-runtime-pseudo-reloc'
PKG_CONFIG_PATH=/mingw/lib/pkgconfig
TERM=cygwin
export CC CFLAGS CXXFLAGS LDFLAGS PKG_CONFIG_PATH TERM


Testing GCC with simple codes


Let's compile a very simple C program. Using a text editor, such as Notepad, create a text file called test.c:


#include <stdio.h>

int main(void)
{
printf("Greetings, ladies and gentlemen.\n");
return 0;
}


The following command will produce an executable code.


gcc -o test.exe test.c


Now, let's try a very simple C++ code:



#include <iostream>
using namespace std;

int main()
{
cout << "Hello, boys and girls.\n";
return 0;
}


To build it, type:


g++ -o test.exe test.cpp


Additonal Tools to Install


You can optionally install other tools from the MinGW download site, such as mingw-utils and bison. mingw-utils provides some useful tools, including dos2unix, a2dll, pexports and reimp. I find dos2unix particularly useful as it converts DOS-style line endings (CR+LF) to UNIX-style (LF) in text files. mingw-utils should be extracted into the MinGW folder and bison should be extracted into the MSYS folder.


Some tools are commonly used in the Linux development environment, such as pkg-config and msgfmt. I've compiled static versions of these programs in order to ease compiling processes. Download them from the links below and place them in /mingw/bin.




Integrated Development Environments for MinGW


If you prefer to use a convenient IDE to the command line, you have several choices:





Related Posts


About This Blog

KBlog logo This blog seeks to share useful information on freely available fonts on the Internet. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

CyberChimps Professional WordPress Themes
Powered By Blogger