.:: 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
compile GNU/Linux binaries in Windows
Old
  (#1)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default compile GNU/Linux binaries in Windows - 21-02-2005

... It's just possible, this is what you need
http://filebase.bots-united.com/inde...on=file&id=278

It's actually just a mere build of the MinGW source code with some extra configs, as MinGW and GNU/Linux version of gcc are actually the same code.

Last edited by Whistler; 06-12-2009 at 21:52..
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#2)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Re: compile GNU/Linux binaries in Windows - 21-02-2005

binaries can be compiled ?
what is this program doing ?
Does it compile source code ? If so, does it have support for SUSv3 or LSBSv2.01 under windows ?


kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#3)
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 - 21-02-2005

it's just a GCC built under Windows in this way:
./configure --prefix=c:/gcc-gnulinux --target=i686-pc-linux-gnu
make
make install

Actually MinGW and *NIX gcc are the same code, this just enabled the GNU/Linux compiling instead of default MinGW Windows compiling. It should compile the same as GNU/Linux, but perhaps you need some extra libraries to compile something other than bots.
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#4)
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 - 21-02-2005

Can it do cross-compiles? I'd be interested in compiling native Linux binaries for my metamod stuff without needing to upload my sources each time on the BU server.



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
  (#5)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: compile GNU/Linux binaries in Windows - 21-02-2005

I just tried it with pbmm but it seems to create a .so file twice the size of when it is compiled on linux and also gets a badf load...
can i compile on the BU server too?

Last edited by sPlOrYgOn; 21-02-2005 at 20:29..
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#6)
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 - 21-02-2005

Anybody who has a shell account on the BU machine can compile his plugins... but I think you don't have one yet because you don't have any website for your bot. One more reason to change that



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
  (#7)
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 - 22-02-2005

well I've found the problem... try NOT to use "-march" parameter (like -march=i586 or so) and use "_i386.so" as the end of the filename and it should work in Metamod

also note that "gcc" is the C compiler, and "g++" is the c++ compiler so make sure you are compiling C++ code with "g++" command.

but the file size is still big, as it's totally staticly linked.

Last edited by Whistler; 22-02-2005 at 02:45..
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#8)
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 - 22-02-2005

well you also need to use the "-static" parameter...

here's the work Makefile
PHP Code:
CPP g++
TARGET podbot_mm
BASEFLAGS 
= -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp
OPTFLAGS 
= -DNDEBUG
CPPFLAGS 
= ${BASEFLAGS} ${OPTFLAGS} -O2 --I"../metamod-1.17/metamod" -I"../hlsdk/multiplayer/common" -I"../hlsdk/multiplayer/dlls" -I"../hlsdk/multiplayer/engine" -I"../hlsdk/multiplayer/pm_shared"

OBJ =     bot.\
    
bot_chat.\
    
bot_client.\
    
bot_combat.\
    
bot_globals.\
    
bot_sounds.\
    
compress.\
    
dll.\
    
engine.\
    
util.\
    
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} -$< -$@ 
looks like it's still far from being perfect

Last edited by Whistler; 22-02-2005 at 06:24..
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#9)
KaCaT
Moderator
 
Status: Offline
Posts: 55
Join Date: Dec 2003
Default Re: compile GNU/Linux binaries in Windows - 22-02-2005

Works fine, thanks!

btw, I've just found another similiar way to compile win32 binaries from linux 8D:
http://www.wxwidgets.org/technote/crosscmp.htm


IvPBot - Improved version of Podbot
  
Reply With Quote
Re: compile GNU/Linux binaries in Windows
Old
  (#10)
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 - 22-02-2005

Yes, and I believe that's what Will Day does with metamod, he compiles everything on GNU/Linuts



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
Reply


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

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