buzzerbazooka
Newbie
This is only an example showing how to get to a Gimp plugin as fast as possible (as you can waste a lot of time with compilation stuff). If you prefer using cygwin, you should better have a look at **broken link removed**. I avoid cygwin, as I don't like to download tons of packages and msys and still something missing...
I'm using a Fedora system with mingw as cross-compiler in this example, as the mingw packages are available through the package manager like in many other distributions. The plugin that I will compile for Windows XP (32 bit) is the Gimp Deskew plugin. Its source code can be downloaded from here.
Besides the Deskew source code we will also need to install some packages i.e. Gimp (we need at least the header files), MingW, etc.. In my case (some build tools were already installed on my system):
We have to unzip and enter the Deskew source code folder:
... and set some variables for the configuration (here is a more detailed description):
The GIMP_LIBS contains the libraries also shown by 'gimptool --libs' and 7 additional ones. Take care of having them in the right order!
The GIMP_CFLAGS are set according to the required libraries.
Specify a folder for the turnkey Deskew plugin:
To run the configuration and generate the Makefiles enter:
Alternatively you could create and run the configure script with the following commands:
If everything went fine, you should be asked to type:
Finally you can put everything you need into the DESTDIR folder (/home/joe/deskew) with:
I'm using a Fedora system with mingw as cross-compiler in this example, as the mingw packages are available through the package manager like in many other distributions. The plugin that I will compile for Windows XP (32 bit) is the Gimp Deskew plugin. Its source code can be downloaded from here.
Besides the Deskew source code we will also need to install some packages i.e. Gimp (we need at least the header files), MingW, etc.. In my case (some build tools were already installed on my system):
Code:
yum install gimp gimp-devel gimp-devel-tools glibc-devel.i686
mingw32-{gcc-c++,pthreads,gdk-pixbuf,cairo,libpng,glib2,pixman,freetype,gtk2,atk,pango,harfbuzz,libltdl,pkg-config}
Code:
unzip -q gimp-deskew-plugin-1.1.zip
cd gimp-deskew-plugin-1.1
Code:
export HOST="i686-w64-mingw32"
export PATH="/usr/$HOST/bin:$PATH"
export DEP_PREFIX="/usr/$HOST/sys-root/mingw"
export PKG_CONFIG_LIBDIR=""
export PKG_CONFIG_PATH="$DEP_PREFIX/lib/pkgconfig"
export ACLOCAL_FLAGS="-I $DEP_PREFIX/share/aclocal"
export RANLIB="$HOST-ranlib"
export CC="$HOST-gcc"
export CXX="$HOST-g++"
export CPP="$HOST-cpp"
export CPATH="$DEP_PREFIX/include"
export C_INCLUDE_PATH="$CPATH"
export CFLAGS="-I$CPATH"
export CXXFLAGS="-I$CPATH"
export CPPFLAGS="-I$CPATH"
export LD_LIBRARY_PATH="$DEP_PREFIX/lib"
export LDFLAGS="-L$LD_LIBRARY_PATH -L$LD_LIBRARY_PATH/gimp -mwindows"
MINGW_INC="$DEP_PREFIX/include"
INC_ARGS="-I$DEP_PREFIX/lib/glib-2.0/include -I$MINGW_INC/glib-2.0 -I$DEP_PREFIX/lib/gtk-2.0/include -I$MINGW_INC/gtk-2.0 -I$MINGW_INC/gdk-pixbuf-2.0 -I$MINGW_INC/cairo -I$MINGW_INC/libpng15 -I$MINGW_INC/pixman-1 -I$MINGW_INC/freetype2 -I$MINGW_INC/atk-1.0 -I$MINGW_INC/pango-1.0 -I$MINGW_INC/harfbuzz -I/usr/include/gimp-2.0"
export GIMP_CFLAGS="-pthread $INC_ARGS"
export GIMP_LIBS="-lglib-2.0 -lgtk-win32-2.0 -lgimpui-2.0-0 -lgimpwidgets-2.0-0 -lgimpmodule-2.0-0 -lgimp-2.0-0 -lgimpmath-2.0-0 -lgimpconfig-2.0-0 -lgimpcolor-2.0-0 -lgimpbase-2.0-0 -lgdk-win32-2.0 -lgdk_pixbuf-2.0 -limm32 -lshell32 -lole32 -latk-1.0 -lpangocairo-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32 -lfreetype -lfontconfig -lpango-1.0 -lm -lcairo -lgobject-2.0 -lintl.dll"
The GIMP_LIBS contains the libraries also shown by 'gimptool --libs' and 7 additional ones. Take care of having them in the right order!
The GIMP_CFLAGS are set according to the required libraries.
Specify a folder for the turnkey Deskew plugin:
Code:
export DESTDIR="/home/joe/deskew"
Code:
./autogen.sh --host=$HOST
Code:
autoreconf -i --force $INC_ARGS
autoheader --force $INC_ARGS
aclocal --force
automake -f
autopoint --force
libtoolize --force
./configure --host=$HOST
Code:
make
Code:
make install