do you use cons or have you made your own makefiles? Would anyone be willing to share their makefiles?
When compiling on Linux
i dunno , i am on windows and need linux files too, maybe someone should post working tutorial …
You can uses cons, althought it may require a little tweaking depending on your particular linux version. You may be better off creating a makefile. If I were to do this, I’g get cons working, and log the output of a complete cons build, and use that to set up the compiler options etc for the makefile.
One thing to be aware of when building on linux is that if you link using a newer gcc and libc, older linux systems may not be able to load it. This has been discussed in other threads, such as this sticky http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=6510
Jaquboss:
If you want to create linux files from windows, your only options would be to cross compile using cygwin (should be possible, but non-trivial) or run linux in something like vmware.
Hmm , i tried cygwin , but dunno if I have enought tools there , also there was no “Perl”
You can install perl with cygwin (through the cygwin setup, AFAIK), but that is the least of the problems. As I said, setting up cygwin to crosscompile to linux is likey non-trivial if it is possible at all, and even then, you surely wouldn’t want to release without actually testing on under linux.
You will be far better off actually installing linux somewhere, or recruiting a linux user to do your linux builds.
OK, how’s this?
Makefile for cgame.mp.i386.so (src/cgame/Makefile):
##----------------------------------------------------------------------------
# Created with genmake.pl v1.1 on Thu Feb 10 23:11:58 2005
# genmake.pl home: http://muquit.com/muquit/software/
# Copryright: GNU GPL (http://www.gnu.org/copyleft/gpl.html)
##----------------------------------------------------------------------------
rm=/bin/rm -f
#CC= gcc -fPIC
CC= gcc -fPIC -DCGAMEDLL
#LINK= ld -shared
LINK= ld -shared -s
DEFS=
AR= ar cq
RANLIB= /usr/bin/ranlib
LIBNAME= cgame.mp.i386.so
INCLUDES= -I. -I..
DEFINES= $(INCLUDES) $(DEFS) -DSYS_UNIX=1
CFLAGS= -g $(DEFINES)
SRCS = ../game/bg_animation.c ../game/bg_animgroup.c ../game/bg_campaign.c ../game/bg_character.c ../game/bg_classes.c ../game/bg_misc.c ../game/bg_pmove.c ../game/bg_slidemove.c ../game/bg_slidemove_prone.c ../game/bg_sscript.c ../game/bg_stats.c ../game/bg_tracemap.c ../game/q_math.c ../game/q_shared.c ../ui/ui_shared.c cg_atmospheric.c cg_character.c cg_commandmap.c cg_consolecmds.c cg_debriefing.c cg_draw.c cg_drawtools.c cg_effects.c cg_ents.c cg_event.c cg_fireteamoverlay.c cg_fireteams.c cg_flamethrower.c cg_gameview.c cg_info.c cg_limbomenu.c cg_limbopanel.c cg_loadpanel.c cg_localents.c cg_main.c cg_marks.c cg_missionbriefing.c cg_multiview.c cg_newDraw.c cg_objectivepanel.c cg_panelhandling.c cg_particles.c cg_players.c cg_playerstate.c cg_polybus.c cg_popupmessages.c cg_predict.c cg_scoreboard.c cg_servercmds.c cg_snapshot.c cg_sound.c cg_spawn.c cg_statsranksmedals.c cg_syscalls.c cg_trails.c cg_view.c cg_weapons.c cg_window.c
OBJS = ../game/bg_animation.o ../game/bg_animgroup.o ../game/bg_campaign.o ../game/bg_character.o ../game/bg_classes.o ../game/bg_misc.o ../game/bg_pmove.o ../game/bg_slidemove.o ../game/bg_slidemove_prone.o ../game/bg_sscript.o ../game/bg_stats.o ../game/bg_tracemap.o ../game/q_math.o ../game/q_shared.o ../ui/ui_shared.o cg_atmospheric.o cg_character.o cg_commandmap.o cg_consolecmds.o cg_debriefing.o cg_draw.o cg_drawtools.o cg_effects.o cg_ents.o cg_event.o cg_fireteamoverlay.o cg_fireteams.o cg_flamethrower.o cg_gameview.o cg_info.o cg_limbomenu.o cg_limbopanel.o cg_loadpanel.o cg_localents.o cg_main.o cg_marks.o cg_missionbriefing.o cg_multiview.o cg_newDraw.o cg_objectivepanel.o cg_panelhandling.o cg_particles.o cg_players.o cg_playerstate.o cg_polybus.o cg_popupmessages.o cg_predict.o cg_scoreboard.o cg_servercmds.o cg_snapshot.o cg_sound.o cg_spawn.o cg_statsranksmedals.o cg_syscalls.o cg_trails.o cg_view.o cg_weapons.o cg_window.o
.c.o:
$(rm) -f $@
$(CC) $(CFLAGS) -c $*.c
all: $(LIBNAME)
$(LIBNAME) : $(OBJS)
$(rm) $@
#$(LINK) -o $(LIBNAME) $(LIBS)
$(LINK) -o $(LIBNAME) *.o
clean:
#$(rm) $(OBJS) $(LIBNAME) core *~
$(rm) *.o $(LIBNAME) core *~
Makefile for qagame.mp.i386.so (src/game/Makefile):
##----------------------------------------------------------------------------
# Created with genmake.pl v1.1 on Thu Feb 10 22:51:08 2005
# genmake.pl home: http://muquit.com/muquit/software/
# Copryright: GNU GPL (http://www.gnu.org/copyleft/gpl.html)
##----------------------------------------------------------------------------
rm=/bin/rm -f
#CC= gcc -fPIC
CC= gcc -fPIC -DGAMEDLL
#LINK= ld -shared
LINK= ld -shared -s
DEFS=
AR= ar cq
RANLIB= /usr/bin/ranlib
LIBNAME= qagame.mp.i386.so
INCLUDES= -I. -I..
DEFINES= $(INCLUDES) $(DEFS) -DSYS_UNIX=1
CFLAGS= -g $(DEFINES)
SRCS = ../botai/ai_cmd.c ../botai/ai_dmgoal_mp.c ../botai/ai_dmnet_mp.c ../botai/ai_dmq3.c ../botai/ai_main.c ../botai/ai_script.c ../botai/ai_script_actions.c ../botai/ai_team.c bg_animation.c bg_animgroup.c bg_campaign.c bg_character.c bg_classes.c bg_misc.c bg_pmove.c bg_slidemove.c bg_slidemove_prone.c bg_sscript.c bg_stats.c bg_tracemap.c g_active.c g_alarm.c g_antilag.c g_bot.c g_buddy_list.c g_character.c g_client.c g_cmds.c g_cmds_ext.c g_combat.c g_config.c g_fireteams.c g_items.c g_main.c g_match.c g_mem.c g_misc.c g_missile.c g_mover.c g_multiview.c g_props.c g_referee.c g_script.c g_script_actions.c g_session.c g_spawn.c g_stats.c g_sv_entities.c g_svcmds.c g_syscalls.c g_systemmsg.c g_target.c g_team.c g_teammapdata.c g_trigger.c g_utils.c g_vote.c g_weapon.c q_math.c q_shared.c
OBJS = ../botai/ai_cmd.o ../botai/ai_dmgoal_mp.o ../botai/ai_dmnet_mp.o ../botai/ai_dmq3.o ../botai/ai_main.o ../botai/ai_script.o ../botai/ai_script_actions.o ../botai/ai_team.o bg_animation.o bg_animgroup.o bg_campaign.o bg_character.o bg_classes.o bg_misc.o bg_pmove.o bg_slidemove.o bg_slidemove_prone.o bg_sscript.o bg_stats.o bg_tracemap.o g_active.o g_alarm.o g_antilag.o g_bot.o g_buddy_list.o g_character.o g_client.o g_cmds.o g_cmds_ext.o g_combat.o g_config.o g_fireteams.o g_items.o g_main.o g_match.o g_mem.o g_misc.o g_missile.o g_mover.o g_multiview.o g_props.o g_referee.o g_script.o g_script_actions.o g_session.o g_spawn.o g_stats.o g_sv_entities.o g_svcmds.o g_syscalls.o g_systemmsg.o g_target.o g_team.o g_teammapdata.o g_trigger.o g_utils.o g_vote.o g_weapon.o q_math.o q_shared.o
.c.o:
$(rm) -f $@
$(CC) $(CFLAGS) -c $*.c
all: $(LIBNAME)
$(LIBNAME) : $(OBJS)
$(rm) $@
#$(LINK) -o $(LIBNAME) $(LIBS)
$(LINK) -o $(LIBNAME) *.o
clean:
#$(rm) $(OBJS) $(LIBNAME) core *~
$(rm) *.o $(LIBNAME) core *~
Makefile for ui.mp.i386.so (src/ui/Makefile):
##----------------------------------------------------------------------------
# Created with genmake.pl v1.1 on Thu Feb 10 22:34:26 2005
# genmake.pl home: http://muquit.com/muquit/software/
# Copryright: GNU GPL (http://www.gnu.org/copyleft/gpl.html)
##----------------------------------------------------------------------------
rm=/bin/rm -f
CC= gcc -fPIC
#LINK= ld -shared
LINK= ld -shared -s
DEFS=
AR= ar cq
RANLIB= /usr/bin/ranlib
LIBNAME= ui.mp.i386.so
INCLUDES= -I. -I..
DEFINES= $(INCLUDES) $(DEFS) -DSYS_UNIX=1
CFLAGS= -g $(DEFINES)
SRCS = ../game/bg_campaign.c ../game/bg_classes.c ../game/bg_misc.c ../game/q_math.c ../game/q_shared.c ui_atoms.c ui_gameinfo.c ui_loadpanel.c ui_main.c ui_players.c ui_shared.c ui_syscalls.c ui_util.c
OBJS = ../game/bg_campaign.o ../game/bg_classes.o ../game/bg_misc.o ../game/q_math.o ../game/q_shared.o ui_atoms.o ui_gameinfo.o ui_loadpanel.o ui_main.o ui_players.o ui_shared.o ui_syscalls.o ui_util.o
.c.o:
$(rm) -f $@
$(CC) $(CFLAGS) -c $*.c
all: $(LIBNAME)
$(LIBNAME) : $(OBJS)
$(rm) $@
#$(LINK) -o $(LIBNAME) $(LIBS)
$(LINK) -o $(LIBNAME) *.o
clean:
#$(rm) $(OBJS) $(LIBNAME) core *~
$(rm) *.o $(LIBNAME) core *~
I haven’t been able to test the compiled files yet, but they do compile. :banghead:
Here’s vanilla etmain compiled with the above makefiles.
If anyone wants to try it for me.
I use cons and it works.
cd WET_Source/src/unix
perl cons -- release gcc3
If i need to add a file into the game library, i edit Conscript-game.
Do you have some problems when compiling ET on Linux ?
alan interesteng in cooperation , or joinging Falckon Studios ? We really need someone to do Linux binaries , unfortunately no one from us uses Linuux :-/
It would always compile, but it never ran right. Maybe it’s just me. :disgust:
But I just tried running a Linux server after compiling with the above makefile and it ran pretty much flawlessly. So they seem to work.
Anyone ever successfully used cygwin to create the .so files under Windows?
I installed cygwin with the gcc packages (with lib’s), perl package and the make package.
I’m tried compiling but I seem to get stuck somewhere in the cons file:
$ cons -- release gcc3
/lib/libc.so.6: not found
Enemy Territory version 2.56
cpu : x86
OS : CYGWIN_NT-5.1
libc:
configured for release build, in directory release-x86-CYGWIN_NT-5.1-
CFLAGS: -pipe -fsigned-char -DMISSIONPACK -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -ffast-math -fno-strict-aliasing -fstrength-reduce -
falign-loops=2 -falign-jumps=2 -falign-functions=2
Ignoring missing script "/cygdrive/c/etmodsources/cleansource/src/extractfuncs/Conscript" (script::Build in Construct, line 334) at ./cons line 749.
cons: don't know how to construct "release-x86-CYGWIN_NT-5.1--gcc3/cgame/src/uni
x/cgame.mp.i386.so"
Anyone knows why it doesn’t know how to construct the file? Something to do with the “/lib/libc.so.6: not found” error at the top?
I also tried using the makefile catscratch posted above to compile the UI shared objects (.so) file.
After solving some parser errors in the makefile and adding a #define linux in the source (else it still seems to use the windows-only functions and give errors) it seems to generate some .o files, but it still doesn’t make the .so file. It gives the following error:
$ make
make: *** No rule to make target `-f', needed by `ui.mp.i386.so'. Stop.
Anyone knows how to solve this error?
You can not cross compile binaries from Windows to Linux using the compiler of cygwin.
You need a package, if it exists …
What Is Cygwin?
# Cygwin is a Linux-like environment for Windows. It consists of two parts: A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
# A collection of tools, which provide Linux look and feel.
How does everything work?
http://cygwin.com/faq/faq_3.html#SEC72
http://cygwin.com/faq/faq_3.html#SEC91
cygwin FAQ
Where is glibc?
Cygwin does not provide glibc. It uses newlib instead, which provides much (but not all) of the same functionality. Porting glibc to Cygwin would be difficult.
To do that under cygwin you will need a “Win to Linux” cross compiler package, and i don’t think it exists.
The easiest way is to compile under Linux. Cons works properly.
Alan
You can try to compile with a Knoppix :
http://knoppix.org/
It is a live CD, you don’t need to install Linux on your Hard Disk to use it (128 MB of RAM is required).
Thanks for the explanation, I was under the impression that cygwin could (cross)compile the ET source into a shared object file (.so) via the normal gcc compiler package.
I still tried compiling using the makefile and I fixed that last error (simple parser error again). But now it’s giving me a load of “undefined reference” errors between the .o files. Don’t think I can fix that.
That Knoppix sounds a bit too experimental and I couldn’t find anything that indicates that it can crosscompile, has anyone compiled the ET source using that?
I guess I’ll have to try compiling it on a Linux box at my college.
Knoppix is a complete Linux system, and put your mind at ease, it is not experimental.
You have all what you need to compile ET on Knoppix Linux.
Why Knoppix ? Because it is easier if you don’t have enough free space on your Hard Disk. Linux can be used from a CD (128 MB of RAM are required).
What is KNOPPIX®?
KNOPPIX is a bootable CD with a collection of GNU/Linux software, automatic hardware detection, and support for many graphics cards, sound cards, SCSI and USB devices and other peripherals. KNOPPIX can be used as a Linux demo, educational CD, rescue system, or adapted and used as a platform for commercial software product demos. It is not necessary to install anything on a hard disk. Due to on-the-fly decompression, the CD can have up to 2 GB of executable software installed on it.