GP32 Wesnoth And Sdl_net


pcklee123

Member
Joined
Nov 14, 2003
Messages
403
I was exploring the possibility of compiling Wesnoth1.1.1 without serious modifications and I get stuck when it looks for SDL_net. Any one plans to add that in since we have working network kernel?

Code:
[wesnoth-1.1.1]# export SDL_CONFIG=/usr/local/gp2xdev/bin/sdl-config

[wesnoth-1.1.1]#./configure --prefix=$GP2XDEV --host=gp2x --build=i686 --enable-tinygui --disable-sdltest --without-x --disable-gnome1 --disable-gnome2 --without-kde --enable-lite --disable-gnome1 --with-freetype-prefix=$GP2XDEV --enable-static  

.
.
        if gp2x-g++ -DHAVE_CONFIG_H -I. -I. -I..   -DUSE_TINY_GUI -I/usr/local/gp2xdev/include/freetype2 -I/usr/local/gp2xdev/include -I ./sdl_ttf -I../intl -I../intl -I/usr/local/gp2xdev/include/SDL -D_REENTRANT  -DWESNOTH_PATH=\"/usr/local/gp2xdev/share/wesnoth\" -DLOCALEDIR=\"translations\" -DHAS_RELATIVE_LOCALEDIR=1 -DFIFODIR=\"/usr/local/gp2xdev/var/run/wesnothd\"  -W -Wall -ansi     -MT actions.o -MD -MP -MF "$depbase.Tpo" -c -o actions.o actions.cpp; \
        then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo"; exit 1; fi
In file included from show_dialog.hpp:23,
                 from playturn.hpp:27,
                 from actions.cpp:22:
network.hpp:19:21: error: SDL_net.h: No such file or directory
make[2]: *** [actions.o] Error 1
make[2]: Leaving directory `/root/wesnoth-1.1.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/wesnoth-1.1.1'
make: *** [all] Error 2
 
Why don't you try compiling SDL_net yourself? If you know enough to be able to recompile an app then you know enough to recompile a lib (most don't need any modifications at all, you just need to mess with the configuration options).
 
woogal posted on Mar 16 2006 at 08:59 AM said:
Why don't you try compiling SDL_net yourself? If you know enough to be able to recompile an app then you know enough to recompile a lib (most don't need any modifications at all, you just need to mess with the configuration options).
OK tried it. you're right wasn't too difficult. But I hope ooPo puts it in the next version of his scripts, cause using his scripts were much easier.
Code:
export SDL_CONFIG=/usr/local/gp2xdev/bin/sdl-config

export CC=gp2x-gcc

 ./configure --host=gp2x --build=i686 --with-sdl-prefix=$GP2XDEV --with-sdl-exec-prefix=$GP2XDEV --disable-sdltest --prefix=$GP2XDEV
 
Last edited by a moderator:
FluffyPanda posted on Mar 16 2006 at 12:12 PM said:
A better idea might be to strip out all the networking code. Lets face it, we're unlikely to need it.
Tried Woogal's suggestion. It's not that difficult
 
Last edited by a moderator:
now I get till here.
Code:
_and_:~/wesnoth-1.1.1/src# make
/usr/bin/libtool --mode=link gp2x-g++ -I ./sdl_ttf -I../intl -I../intl -I/usr/local/gp2xdev/include/SDL -D_REENTRANT  -DWESNOTH_PATH=\"/usr/local/gp2xdev/share/wesnoth\" -DLOCALEDIR=\"translations\" -DHAS_RELATIVE_LOCALEDIR=1 -DFIFODIR=\"/usr/local/gp2xdev/var/run/wesnothd\"  -W -Wall -ansi      -all-static -o wesnoth  about.o actions.o ai.o ai_dfool.o ai_attack.o ai_move.o ai_python.o animated.o astarnode.o builder.o cavegen.o checksum.o clipboard.o color_range.o config_adapter.o cursor.o dialogs.o display.o events.o font.o game.o game_events.o gamestatus.o halo.o help.o hotkeys.o image.o intro.o key.o language.o leader_list.o map_create.o map_label.o mapgen.o mapgen_dialog.o marked-up_text.o menu_events.o minimap.o mouse.o mouse_events.o multiplayer.o multiplayer_ui.o multiplayer_wait.o multiplayer_connect.o multiplayer_create.o multiplayer_lobby.o network.o network_worker.o pathfind.o playcampaign.o playlevel.o playturn.o preferences.o preferences_display.o publish_campaign.o replay.o replay_controller.o reports.o sdl_utils.o show_dialog.o sound.o statistics.o team.o theme.o titlescreen.o tooltips.o unit.o unit_display.o unit_types.o unit_animation.o upload_log.o variable.o video.o serialization/binary_or_text.o serialization/parser.o serialization/string_utils.o widgets/button.o widgets/combo.o widgets/label.o widgets/menu.o widgets/image_button.o widgets/progressbar.o widgets/scrollarea.o widgets/scrollbar.o widgets/scrollpane.o widgets/slider.o widgets/textbox.o widgets/widget.o sdl_ttf/SDL_ttf.o -L. -lwesnoth-core     /usr/local/gp2xdev/lib/libSDL.la   -L/usr/local/gp2xdev/lib -Wl,--rpath -Wl,/usr/local/gp2xdev/lib -lfreetype   
libtool: link: unable to infer tagged configuration
libtool: link: specify a tag with `--tag'
make: *** [wesnoth] Error 1

what is libtool? what is tag?
what is libSDL.la? why?
I can manually run

Code:
gp2x-g++ -I ./sdl_ttf -I../intl -I../intl -I/usr/local/gp2xdev/include/SDL -D_REENTRANT  -DWESNOTH_PATH=\"/usr/local/gp2xdev/share/wesnoth\" -DLOCALEDIR=\"translations\" -DHAS_RELATIVE_LOCALEDIR=1 -DFIFODIR=\"/usr/local/gp2xdev/var/run/wesnothd\"  -W -Wall -ansi      -all-static -o wesnoth  about.o actions.o ai.o ai_dfool.o ai_attack.o ai_move.o ai_python.o animated.o astarnode.o builder.o cavegen.o checksum.o clipboard.o color_range.o config_adapter.o cursor.o dialogs.o display.o events.o font.o game.o game_events.o gamestatus.o halo.o help.o hotkeys.o image.o intro.o key.o language.o leader_list.o map_create.o map_label.o mapgen.o mapgen_dialog.o marked-up_text.o menu_events.o minimap.o mouse.o mouse_events.o multiplayer.o multiplayer_ui.o multiplayer_wait.o multiplayer_connect.o multiplayer_create.o multiplayer_lobby.o network.o network_worker.o pathfind.o playcampaign.o playlevel.o playturn.o preferences.o preferences_display.o publish_campaign.o replay.o replay_controller.o reports.o sdl_utils.o show_dialog.o sound.o statistics.o team.o theme.o titlescreen.o tooltips.o unit.o unit_display.o unit_types.o unit_animation.o upload_log.o variable.o video.o serialization/binary_or_text.o serialization/parser.o serialization/string_utils.o widgets/button.o widgets/combo.o widgets/label.o widgets/menu.o widgets/image_button.o widgets/progressbar.o widgets/scrollarea.o widgets/scrollbar.o widgets/scrollpane.o widgets/slider.o widgets/textbox.o widgets/widget.o sdl_ttf/SDL_ttf.o -L. -lwesnoth-core -L/usr/local/gp2xdev/lib -Wl,--rpath -Wl,/usr/local/gp2xdev/lib -lfreetype -lpthread -lSDL_mixer -lsmpeg -lmikmod -lSDL_net -lSDL_image -lSDL -lvorbisfile -lvorbis -logg -lpng -ljpeg -lz -lvorbisenc -lvorbisidec -static 
/usr/local/gp2xdev/lib/libSDL_net.a(SDLnet.o): In function `SDLNet_ResolveIP':
/mnt/l1/root/downloads/newtoolchain/SDL_net-1.2.5/SDLnet.c:351: warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/gp2xdev/lib/libSDL_net.a(SDLnet.o): In function `SDLNet_ResolveHost':
/mnt/l1/root/downloads/newtoolchain/SDL_net-1.2.5/SDLnet.c:324: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
 
OK got it all compiled. Now it starts up but no sound and after some time it gives a very small (1024x768 rescaled to 320x240) startup screen. can't move the cursor so may need rewriting of mouse & keyboard code.
 
A long time ago I compiled wesnoth, now i have wesnoth working and the mouse moves using the stick, althought the game runs very slow.

To compile it try a command like that:
Code:
gp2x-g++ -I ./sdl_ttf -I../intl -I../intl -I/usr/local/gp2xdev/include/SDL -D_REENTRANT  -DWESNOTH_PATH=\"/mnt/sd/wesnoth\" -DLOCALEDIR=\"translations\" -DHAS_RELATIVE_LOCALEDIR=1 -DFIFODIR=\"/mnt/sd/wesnoth/wesnothd\"  -g -O2   -DPREFERENCES_DIR=\"yes\"  -static -o wesnoth  about.o actions.o ai.o ai_dfool.o ai_attack.o ai_move.o ai_python.o animated.o astarnode.o builder.o cavegen.o checksum.o clipboard.o color_range.o config_adapter.o cursor.o dialogs.o display.o events.o font.o game.o game_events.o gamestatus.o halo.o help.o hotkeys.o image.o intro.o key.o language.o leader_list.o map_create.o map_label.o mapgen.o mapgen_dialog.o marked-up_text.o menu_events.o minimap.o mouse.o mouse_events.o multiplayer.o multiplayer_ui.o multiplayer_wait.o multiplayer_connect.o multiplayer_create.o multiplayer_lobby.o network.o network_worker.o pathfind.o playcampaign.o playlevel.o playturn.o preferences.o preferences_display.o publish_campaign.o replay.o replay_controller.o reports.o sdl_utils.o show_dialog.o sound.o statistics.o team.o theme.o titlescreen.o tooltips.o unit.o unit_display.o unit_types.o variable.o video.o serialization/binary_or_text.o serialization/parser.o serialization/string_utils.o widgets/button.o widgets/combo.o widgets/label.o widgets/menu.o widgets/image_button.o widgets/progressbar.o widgets/scrollarea.o widgets/scrollbar.o widgets/scrollpane.o widgets/slider.o widgets/textbox.o widgets/widget.o sdl_ttf/SDL_ttf.o -L. -lwesnoth-core -lSDL_image -lSDL_mixer -lSDL_net  -L/usr/local/gp2xdev/lib -Wl,-rpath,/usr/local/gp2xdev/lib -lSDL -lpthread   -L/usr/local/gp2xdev/lib -Wl,--rpath -Wl,/usr/local/gp2xdev/lib -lfreetype -lz -ljpeg -lpng12 -lgcc -lSDLmain -lmikmod -logg -ldl -lSDL -lpng -lz -lm -lvorbisidec

Then ignore the warnings, put the data and the executable in a file. You'll need a script named wesnoth.gpe to execute correctly wesnoth:
Code:
./wesnoth ./ --resolution 320x240 --bpp 16 
sync
cd /usr/gp2x
exec /usr/gp2x/gp2xmenu
 
Thanks Bud, I'm currently modifying events.cpp to try to get mouse working. I suppose I should relax and wait for your release as you seem to have made much more progress than I have.
 
Back
Top