A downstream Linux fork of d2x-xl

All other topics around Descent and D2X-XL

Moderators: Frustikus, simX, Aus-RED-5

darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Thu Jun 26, 2014 11:09 pm

Yah that would be a good idea to setup. Sometimes I see a build folder and people run cmake ..

Anyway, I did start from scratch (keeping the cmakelists.txt) no dice.
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: A downstream Linux fork of d2x-xl

Postby karx11erx » Fri Jun 27, 2014 12:30 am

Regarding ipx.h and ipx_bsd.c: ipx_bsd.c is probably not being built by my d2x-xl build process for linux. However, you can try to replace <linux/ipx.h> with "ipx.h" and see whether that works.
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 12:47 am

@ darklord42: Yeah, that's the normal setup. For d2x-xl (upstream or my fork), it'd be copy-paste something like:

Code: Select all

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j5


I'm putting some of the changes into my branch now. Try that and paste any errors. I did give __unix__, so expect those errors, but they need fixed anyways.

Code: Select all

git clone git://github.com/webgeek1234/d2x-xl.git
git checkout osx
*see above*


@karx: No? I just turned on as many flags as I could get to compile. Which wasn't terribly many. :P But ipx worked under linux. Do you think I should remove the preprocessor flag and file?

Steel01
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Fri Jun 27, 2014 1:02 am

ok, your branch is complaining about the windows.h, did you define __apple__ elsewhere?
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 1:19 am

Sorry, I put an edit in. I forgot to specify the branch. git checkout osx. Then try again.

Steel01

Edit: Okay, braincramp, not paying attention, and making things too convoluted for my own good all rolled into one. Long story short, the osx branch didn't exist on github until a minute or so ago. Many apologies for the confusion.

Edit 2: I'm trying to do all this too late at night and on not enough sleep. Several snafu's later, the osx attempt code is in my master branch and I'm too tired to care right now. So, just do a git pull and you should be able to get something further than before. Warning, though. If you do get it to compile, I appear to have a memory leak in hires loading that's not in upstream. I'll try to track it down tomorrow. I have no idea how it got there, though...
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Fri Jun 27, 2014 4:36 am

Hey no problem, sorry to keep you so busy. there is no rush. Slow and steady wins the race as they say :) I know you had your own goals too with the linux stuff.

I did get to the __unix__ based errors at the beginning I mentioned before.
(put it on paste bin to save the forums from getting too flooded)
http://pastebin.com/KibMZnVe
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: A downstream Linux fork of d2x-xl

Postby karx11erx » Fri Jun 27, 2014 7:12 am

steel01 wrote:Edit 2: I'm trying to do all this too late at night and on not enough sleep.


Welcome to my world. Can't count those nights anymore. :P
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 12:34 pm

Can't find ulong? A google suggests it should... But to get the code path that was compiling before, a simple change should work. In include/pstypes.h line 31 (if !defined unix or defined FreeBSD), add '|| defined(__macosx__)'. Should get rid of this batch of errors. I'd like to wait to push another commit until this compiles. The lower the commit count, the easier it will be for me to put together a patch for karx.

Steel01

Edit: Nights normally works great for me. Night owl here. But for some reason, last night just wasn't good for me. *shrugs* Oh, well.
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Fri Jun 27, 2014 12:50 pm

I'm happy to be the guinea pig :)
that last comment worked and got rid of the errors,

now we are back to:

Code: Select all

/Users/herecomethej/d2x-xl/network/linux/ipx_bsd.cpp:17:24: fatal error: linux/ipx.h: No such file or directory
 # include <linux/ipx.h>
                        ^
compilation terminated.
make[2]: *** [CMakeFiles/d2x-xl_9cca1a9.dir/network/linux/ipx_bsd.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/d2x-xl_9cca1a9.dir/all] Error 2
make: *** [all] Error 2


I had already tried copying the ipx.h in the source in such a folder, but It didn't like that one bit.
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 1:25 pm

Meh. Looks like I will have to split up the source file defines per os. For now, toward the bottom of the cmakelists, find where I set network_sources. Then remove ukali and any with ipx in the name. See what that does.

And yay for testers. Without y'all, it's nigh impossible to cover all cases.

Steel01
darklord42
Posts: 254
Joined: Sat Nov 17, 2007 3:01 am
Contact:

Re: A downstream Linux fork of d2x-xl

Postby darklord42 » Fri Jun 27, 2014 1:45 pm

OK in the linking process now :

Code: Select all

Undefined symbols for architecture x86_64:
  "GetOSXAppFolder(char*, char*)", referenced from:
      GetAppFolders(bool) in gamefolders.cpp.o
  "GetMacOSXCacheFolder()", referenced from:
      GetAppFolders(bool) in gamefolders.cpp.o
  "NativeMacOSXMessageBox(char const*)", referenced from:
      D2MsgBox(char const*, unsigned int) in error.cpp.o
      Warning(char const*, ...) in error.cpp.o
  "_ipx_mcast4", referenced from:
      ArchIpxSetDriver(int)  in linuxnet.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [d2x-xl_9cca1a9] Error 1
make[1]: *** [CMakeFiles/d2x-xl_9cca1a9.dir/all] Error 2
make: *** [all] Error 2


I guess I should remove linuxnet as well, but what should we do about the others?

I'll be back later today.
Macbook Pro 6,2
Mac OS. 10.9.3
2.8 GHz Intel i7
8 GB RAM
GeForce GT 340M 512mb/Intel HD Graphics
Intel HD Audio
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 2:04 pm

Great, this last part should fix that. I've pushed some changes to my fork. So, do a 'git reset --hard HEAD' to undo your changes, then pull the update. I removed linuxnet as it is the Linux ipx implementation (yay, proper comments in file!) and added the .mm files in the macosx directory to the source list. That should resolve the link errors. I don't think the sdlmain is referenced, though. Don't know if that will cause a problem.

On another note, I'm working on cleaning the clang warnings. Hey karx, in transprender.h around line 40, why is the assignment operator overridden with a memcpy? That trashes some of the class info. Clang complains about it and removing the override compiles fine. Any reason the built in class assignment operator won't work there?

Steel01
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: A downstream Linux fork of d2x-xl

Postby karx11erx » Fri Jun 27, 2014 2:17 pm

The current OS X version is a W.I.P.!!!
steel01
Posts: 89
Joined: Mon Jun 02, 2014 11:44 am

Re: A downstream Linux fork of d2x-xl

Postby steel01 » Fri Jun 27, 2014 2:26 pm

I'm warning cleaning with a Linux clang compiler. The warning I asked about should apply across the board though. *shrugs* I like my fork to be as warning free as possible. I've got several GCC warning fixes you haven't got to yet. And one of these days I'll submit a patch for them.

For me, this cmake venture is just to get basic compilation support for osx. And maybe a bit of research into building the .app if it isn't too hard.

Steel01
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: A downstream Linux fork of d2x-xl

Postby karx11erx » Fri Jun 27, 2014 5:55 pm

My comment is not about an alternative project file/IDE, it is about you tinkering around with the code with in an improvised way, without any real knowledge of it, when the issues you are trying to solve are just temporary because the OS X coder and I are working on it.

Certain g++ warnings are totally nonsense (e.g. the one about safe format strings). This is something I will never change in the code.

Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests