Technical support > Linux

[RESOLVED] Crosscompiling from Linux for Windows

<< < (2/4) > >>

MarcoBi:

--- Quote from: Mattn on September 21, 2010, 05:02:58 pm ---yes, you have to apply it - but try to use git apply patch.diff

--- End quote ---

I have configured with

--- Code: ---./configure --enable-release --disable-signals --disable-backtraces --target-os=mingw32
--- End code ---

and then tweaked a little mingw32.mk as

--- Code: ---SO_EXT                    = dll
SO_LDFLAGS                = -shared
SO_CFLAGS                 = -shared

EXE_EXT                   = .exe

CC_PATH                   = /opt/mingw/usr/i686-pc-mingw32

# TODO: config.h
CFLAGS                   += -DSHARED_EXT=\"$(SO_EXT)\"
CFLAGS                   += -DGETTEXT_STATIC
# Windows XP is the minimum we need
CFLAGS                   += -DWINVER=0x501

CURL_CONFIG              ?= $(CC_PATH)/bin/curl-config
CURL_LIBS                ?= $(shell $(CURL_CONFIG) --libs) -lrtmp -lssl -lcrypto -lz -lws2_32 -lwinmm -lgdi32
CURL_CFLAGS              ?= $(shell $(CURL_CONFIG) --cflags)
SDL_CONFIG               ?= $(CC_PATH)/bin/sdl-config
SDL_LIBS                 ?= $(shell $(SDL_CONFIG) --libs)
SDL_CFLAGS               ?= $(shell $(SDL_CONFIG) --cflags)
OPENGL_CFLAGS            ?=
OPENGL_LIBS              ?= -lopengl32
PKG_CONFIG               ?= $(CROSS)pkg-config
SDL_TTF_LIBS             ?= $(call PKG_LIBS,SDL_ttf) $(call PKG_LIBS,freetype2)
SDL_TTF_CFLAGS           ?= $(call PKG_CFLAGS,SDL_ttf) $(call PKG_CFLAGS,freetype2)
SDL_IMAGE_LIBS           ?= $(call PKG_LIBS,SDL_image)
SDL_IMAGE_CFLAGS         ?= $(call PKG_CFLAGS,SDL_image)
SDL_MIXER_LIBS           ?= $(call PKG_LIBS,SDL_mixer)
SDL_MIXER_CFLAGS         ?= $(call PKG_CFLAGS,SDL_mixer)
OPENAL_CFLAGS            ?= $(call PKG_CFLAGS,openal)
OPENAL_LIBS              ?= $(call PKG_LIBS,openal)
THEORA_CFLAGS            ?= $(call PKG_CFLAGS,theora)
THEORA_LIBS              ?= $(call PKG_LIBS,theora)
GLIB_CFLAGS              ?= $(call PKG_CFLAGS,glib-2.0)
GLIB_LIBS                ?= $(call PKG_LIBS,glib-2.0)
GTK_CFLAGS               ?= $(call PKG_CFLAGS,gtk+-2.0)
GTK_LIBS                 ?= $(call PKG_LIBS,gtk+-2.0)
GTK_SOURCEVIEW_CFLAGS    ?= $(call PKG_CFLAGS,gtksourceview-2.0)
GTK_SOURCEVIEW_LIBS      ?= $(call PKG_LIBS,gtksourceview-2.0)
GTK_GLEXT_CFLAGS         ?= $(call PKG_CFLAGS,gtkglext-1.0)

ufo_LDFLAGS              += -lws2_32 -lwinmm -lgdi32 -lintl -lfreetype
ufoded_LDFLAGS           += -lws2_32 -lwinmm -lgdi32
testall_LDFLAGS          += -lwinmm -lgdi32
ufo2map_LDFLAGS          += -lwinmm
ufomodel_LDFLAGS         += -lwinmm
uforadiant_LDFLAGS       += -lglib-2.0 -lgtk-win32-2.0 -lgobject-2.0 -lstdc++
--- End code ---

but...

--- Code: ---marco@MarcoBi:/opt/src/ufoai$ make
Platform:     linux
Target:       mingw32
Architecture: i386
Compiler:     i686-pc-mingw32-cc
Targets:      game testall ufo ufo2map ufoded ufomodel uforadiant uforadiant-brushexport
===> LD [base/game.dll]
===> LD [testall.exe]
===> LD [ufo.exe]
===> LD [ufo2map.exe]
===> LD [ufoded.exe]
===> LD [ufomodel.exe]
===> LD [radiant/uforadiant.exe]
release-linux-i386/uforadiant/tools/radiant/radiant/dialogs/about.cpp.o: In function `_Z7DoAboutv':
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:130: undefined reference to `__imp__gtk_micro_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:130: undefined reference to `__imp__gtk_minor_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:130: undefined reference to `__imp__gtk_major_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:140: undefined reference to `__imp__gtkglext_micro_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:140: undefined reference to `__imp__gtkglext_minor_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:140: undefined reference to `__imp__gtkglext_major_version'
collect2: ld returned 1 exit status
make: *** [radiant/uforadiant.exe] Errore 1
--- End code ---

I have only static libraries, so... do I need shared libraries? (that's not the case of mingw cross env)

Best reagrds

Mattn:
yes, in mingw32.mk is the pkg-config call for the libs of gtkglext missing.

Mattn:
btw. please post a diff when you fixed something on the makefile, not the full file.

MarcoBi:

--- Quote from: Mattn on September 22, 2010, 04:40:16 pm ---btw. please post a diff when you fixed something on the makefile, not the full file.

--- End quote ---

Here is the patch for my modified mingw32.mk Makefile.

Can I repost my compilation attempt when I'll rebuild a shared version of the GTK stack in my cross compile env?

Bye!

MarcoBi:

--- Quote from: Mattn on September 22, 2010, 04:39:36 pm ---yes, in mingw32.mk is the pkg-config call for the libs of gtkglext missing.

--- End quote ---

It's not missing, I have

--- Code: ---GTK_GLEXT_CFLAGS         ?= $(call PKG_CFLAGS,gtkglext-1.0)
GTK_GLEXT_LIBS           ?= $(call PKG_LIBS,gtkglext-1.0)
--- End code ---

Bye

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version