.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Programming
General Programming Help others and get yourself helped here!

Reply
 
Thread Tools
Re: compile GNU/Linux binaries in Windows
Old
  (#11)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: compile GNU/Linux binaries in Windows - 22-02-2005

Can someone explain me how to compile with this EPB. It will be good to have a linux version.
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#12)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: compile GNU/Linux binaries in Windows - 22-02-2005

So, how do I cross compile for the PDP-11?


sfx1999.postcount++
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#13)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: compile GNU/Linux binaries in Windows - 23-02-2005

"Can someone explain me how to compile with this EPB. It will be good to have a linux version."
just create a file named "Makefile" in your source directory, like this one:
PHP Code:
 CPP g++
TARGET epb
BASEFLAGS 
= -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp
OPTFLAGS 
= -DNDEBUG
CPPFLAGS 
= ${BASEFLAGS} ${OPTFLAGS} -O2 --I"./hlsdk"

OBJ =     bot.o
    bot_chat
.o
    bot_client
.o
    bot_combat
.o
    bot_globals
.o
    bot_sounds
.o
    compress
.o
    dll
.o
    engine
.o
    util
.o
    waypoint
.o

${TARGET}_i386.so: ${OBJ}
    ${
CPP} -fPIC -shared -static -$@ ${OBJ} -ldl -lm

clean
:
    
rm -*.o
    rm 
-*.map

%.o:    %.cpp
    
${CPP} ${CPPFLAGS} -$< -$@

%.
o:    %.c
    
${CPP} ${CPPFLAGS} -$< -$@ 
(note that you MUST have a backslash after each ".o" file; the forum has bugs which ate up all backslashes)

write all your .cpp files in the list, change all .cpp to .o.

Then install the compiler, start a DOS prompt, run the setvars.bat file first and change into your source dir. Then run "make" and it should produce a epb_i386.so file and that's it.
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#14)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: compile GNU/Linux binaries in Windows - 23-02-2005

Quote:
Originally Posted by Whistler
(note that you MUST have a backslash after each ".o" file; the forum has bugs which ate up all backslashes)
I wonder what it would be like with the [ code ] tags instead...
Code:
CPP = g++ 
TARGET = epb 
BASEFLAGS = -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp 
OPTFLAGS = -DNDEBUG 
CPPFLAGS = ${BASEFLAGS} ${OPTFLAGS} -O2 -w -I"./hlsdk" 
 
OBJ =	 bot.o \\
	bot_chat.o \\
	bot_client.o \\
	bot_combat.o \\ 
	bot_globals.o \\
	bot_sounds.o \\
	compress.o \\
	dll.o \\
	engine.o \\
	util.o \\
	waypoint.o
 
${TARGET}_i386.so: ${OBJ} 
	${CPP} -fPIC -shared -static -o $@ ${OBJ} -ldl -lm 
 
clean: 
	rm -f *.o 
	rm -f *.map 
 
%.o:	%.cpp 
	${CPP} ${CPPFLAGS} -c $< -o $@ 
 
%.o:	%.c 
	${CPP} ${CPPFLAGS} -c $< -o $@
*edit* damn, yer right.
I'd better look into that someday.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#15)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: compile GNU/Linux binaries in Windows - 23-02-2005

It's not working :
here is the error messege:
make : <e=2>:
make : *** [EPB_i386.so] Error 2

Last edited by The Storm; 23-02-2005 at 17:53..
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#16)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: compile GNU/Linux binaries in Windows - 24-02-2005

in which step this error happened? would you post the full output?

(also you need to add the log.o to the list in Makefile if you haven't deleted it, and if you've created new files you need to add them as well)

Last edited by Whistler; 24-02-2005 at 02:27..
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#17)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: compile GNU/Linux binaries in Windows - 24-02-2005

Here :

dll.cpp:20: error: expected `>` before '*' token
dll.cpp:20: error: expected `,` or `;` before '*' token
dll.cpp:22: error: expected `>` before '*' token
dll.cpp:22: error: expected `,` or `;` before '*' token
dll.cpp:29: error: `GETNEWDLLFUNCTIONS` does not name a type
make: *** [dll.o] Error 1

The strange is that when I compile it with MSVC there is no problem.
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#18)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: compile GNU/Linux binaries in Windows - 25-02-2005

then it's bacause something GNU/Linux specific is missing in the code... you gotta fix it first
search for "__linux__" in HPB bot and you'll see what's required

edit: I think this is the problem:
PHP Code:
// stuff for Win32 vs. Linux builds

#ifndef __linux__

typedef int (FAR *GETENTITYAPI)(DLL_FUNCTIONS *, int);
typedef int (FAR *GETNEWDLLFUNCTIONS)(NEW_DLL_FUNCTIONS *, int *);
typedef void (DLLEXPORT *GIVEFNPTRSTODLL)(enginefuncs_t *, globalvars_t *);
typedef void (FAR *LINK_ENTITY_FUNC)(entvars_t *);

#else

#include <dlfcn.h>
#define GetProcAddress dlsym

typedef int BOOL;

typedef int (*GETENTITYAPI)(DLL_FUNCTIONS *, int);
typedef int (*GETNEWDLLFUNCTIONS)(NEW_DLL_FUNCTIONS *, int *);
typedef void (*GIVEFNPTRSTODLL)(enginefuncs_t *, globalvars_t *);
typedef void (*LINK_ENTITY_FUNC)(entvars_t *);

#endif 
and it seems that in POD-Bot the GETNEWDLLFUNCTIONS isn't declared after the #else.

Last edited by Whistler; 25-02-2005 at 06:57..
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#19)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: compile GNU/Linux binaries in Windows - 26-02-2005

Thanks you Whistler. You was write ! The problem was in bot.h.
Now I succseful compile EPB for Linux. With the next release I will publish and the Linux version of EPB.
Thnaks you again.

EDIT : Did I must publish the source code of EPB if I publish a Linux version ?

Last edited by The Storm; 26-02-2005 at 12:47..
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#20)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: compile GNU/Linux binaries in Windows - 27-02-2005

"Did I must publish the source code of EPB if I publish a Linux version ?"
Nope, as you are just *USING* gcc, which is totally free and not restricted
perhaps you can read through the GPL to see in which case you need to release the sources.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com