?

Log in

Previous Entry | Next Entry

This is mostly a note to myself so I can repeat this process, but I'm posting it here so anyone else interested in doing this might benefit.


- Install the mingw* packages from the software repository.
- download the GTK Windows development package from the GTK for Windows site.
- copy the Windows GTK directories to /usr/i586-mingw32msvc/
- fix the permissions with
sudo chown -R root.root *; find . -type d -exec chmod a+x {} \;

- fix up the files in /usr/i586-mingw32msvc/lib/pkgconfig to have the right prefix:
sudo sed -i "s%^prefix=.*$%prefix=/usr/i586-mingw32msvc%" *


Next, create a GTK app in Anjuta, and tweak the files below.

configure.ac add this bit below AM_MAINTAINER_MODE:
case "${host}" in
        i[[3456789]]86-mingw32*) 
        	WIN32="yes"
			;;
        *cygwin*) 
        	WIN32="yes" 
        	;;
        *) 
        	WIN32="no" 
        	;;
esac
AM_CONDITIONAL([WIN32], test "$WIN32" = "yes")


comment out AC_PROG_LIBTOOL, and add this rule after:
AC_CHECK_TOOL( [RC], [windres], [no] )


src/Makefile.am change the project LDFLAGS to:
if WIN32
x_SOURCES += 	\
	windows.rc
	
x_LDFLAGS = \
	-Wl,--export-all-symbols,--subsystem,windows

else
x_LDFLAGS = \
	-Wl,--export-dynamic
endif


and add this rule to the end:
.rc.o:
	$(RC) -i "$<" -o "$@"


windows.rc create this and insert
id ICON "x.ico"
1 VERSIONINFO
FILEVERSION     1,0,0,0
PRODUCTVERSION  1,0,0,0
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "040904E4"
    BEGIN
      VALUE "CompanyName", "x"
      VALUE "FileDescription", "x"
      VALUE "FileVersion", "1.0"
      VALUE "InternalName", "x"
      VALUE "LegalCopyright", "x"
      VALUE "OriginalFilename", "x.exe"
      VALUE "ProductName", "x"
      VALUE "ProductVersion", "1.0"
    END
  END

  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", 0x409, 1252
  END
END


- Finally, create a Windows Debug profile in Anjuta by copying the Debug profile and adding the flag
--host=i586-mingw32msvc
to the options, and creating a new directory for the Windows build.
- Profit

Comments

( 1 comment — Leave a comment )
mountain_hiker
Apr. 26th, 2011 03:16 pm (UTC)
I don't speak this language. :P
( 1 comment — Leave a comment )

Profile

Shirase
browren
BroWren

Latest Month

September 2014
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930    

Tags

Powered by LiveJournal.com
Designed by Keri Maijala