Jump to content

[WIP] Compiling under NetBSD, that is the question


Guest lakomok

Recommended Posts

Hi,

I have written patches for g3dlite and tbb and added a "#ifdef" in src/shared/vmap/BIH.h in order to compile MaNGOS under NetBSD.

I'm not sure if I have to submit it because everything compiles fine but MaNGOS don't work (because of problems inside threads that I don't fix yet).

So, is it worth submiting patches that may be useless (if I don't succeed in fixing threads for NetBSD) ?

Link to comment
Share on other sites

Ok! So here we go.

What bug does the patch fix? What features does the patch add?

These patches allow MaNGOS to compile under NetBSD (i386 4.0.1 tested)

1. dep - g3dlite patch : #define stuffs with creation of a custom G3D_NETBSD define and a explicit use of G3D_FREEBSD where it was messed up with G3D_LINUX (while doing it for G3D_NETBSD, it would have been silly no to do it for G3D_FREEBSD too)

2. dep - tbb patch : #define stuffs too, creation of Makefile's .inc files for NetBSD and writting of platform specific DetectNumberOfWorkers() very similar to OS X (HW_NCPU instead of HW_AVAILCPU)

3. src - shared/vmap fix : Under NetBSD isnan() is already defined by system's includes, so I just add a simple #ifndef according to that

For which repository revision was the patch created?

10610

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

Nope.

Who has been writing this patch? Please include either forum user names or email addresses.

lakomok

1. dep - g3dlite : http://paste2.org/p/1045199

2. dep - tbb : http://paste2.org/p/1045204

3. src - shared/vmap fix : http://paste2.org/p/1045207

And I hope that I did it as required.

Link to comment
Share on other sites

  • 1 month later...

Well... well, well, well.

I do not managed to get the thing working under NetBSD (mostly because I don't have enough time to get deeper in it).

Moreover, as nobody even answer on this thread... I think it's better not to loose my time anymore.

A coding projet on spare time is difficult, that's the point.

Nevermind.

Link to comment
Share on other sites

I for example just randomly open this thread... I _very_ seldom read codemods section, just becase it mostly for custom or early stage patchs. _all_ patches suggested for including into core must be submited to underreview section if you want at least chance for fast review.

Now about patch.

In g3d case you add some for linux cases also freebsd. I not read about any problems at freebsd with current g3d sources (but not look exactly context where you modify lines by adding FreeBSD case).

About generic changes. g3d is 3rd party library so we prefer do limited modifications. Why not just add use G3D_FREEBSD for netbsd case as done already for openbsd. I think this lot more local change.

For vmap part not have problem with suggested change.

About tbb: strange that NetBSD support absent, but maybe better suggest patch to tbb team... It active developped and you expected to get fast responce... Then it can be cherry-picked in added form or tbb version updated.

Link to comment
Share on other sites

I for example just randomly open this thread... I _very_ seldom read codemods section, just becase it mostly for custom or early stage patchs. _all_ patches suggested for including into core must be submited to underreview section if you want at least chance for fast review.

Sure, but my work was not even "alpha" release. It can wait later to be submitted for real.

Now about patch.

In g3d case you add some for linux cases also freebsd. I not read about any problems at freebsd with current g3d sources (but not look exactly context where you modify lines by adding FreeBSD case).

About generic changes. g3d is 3rd party library so we prefer do limited modifications. Why not just add use G3D_FREEBSD for netbsd case as done already for openbsd. I think this lot more local change.

Why ?

Because I would like to make it very clean. I think it is better to use a define in its exact meaning and not because "it would work the same than an other one".

I prefer something like :

#if defined(__A__) || defined(__B__) || ... || defined(__Z__)
blabla
#endif

instead of

#if defined(__B__) || ... || defined(__Z__)
#   define __A__
#endif

#ifdef __A__
blabla
#endif

Even if it doesn't change anything for now, it would later. For that kind of platform specific code, if it has to fork, the sooner is the better.

But, anyway, I've very hardly found time to write those small patches that juste make NetBSD compiles.

In comparaison, the work to make NetBSD runs is huge and I don't feel like succeeding.

Thank you for pushing me not to give up.

Link to comment
Share on other sites

Have big different in good code style for custom local changes in 3rd party lib and clean own project code.

For first case batter have small hack change that resolve problem that big clean rewrite half of 3r-lib ;), for second case ofc you are right.

when this changes will be added to mangos repo its all expected to be with comments as mangos local modifications.

This need for later 3rd lib update for prevent lost changes and constant redo and re-resolve problems.

Link to comment
Share on other sites

Before doing this, I wondered myself about modifying 3rd party lib.

I had looked around the code and I found lines of code that looked like custom modifications. It made me think I can do it.

I also noticed that not all g3d is used by MaNGOS, there is C files that only exist but makefile do not deals with them.

I guess it's the difficult point in using 3rd party lib.

But don't worry, I would like to contribute in a "MaNGOS community compliant" way. I'm ready to read that I did wrong and why, ready to change my work in order to stick to projet's rules. It's just a question of time and being used to those rules.

The idea of being NetBSD leader is very nice but I really don't want to become such a person and then fail everyone because I wouldn't manage to get enough spare time for it (I already did it for another projet and it's bad !).

To be continued.

Link to comment
Share on other sites

  • 5 months later...

For those who were wondering about the NetBSD stuff I tried to do...

I apologize for not talking here for a while.

And I also apologize for giving up the idea.

I did not succeed to do it because there is no glibc under NetBSD and I didn't manage to find any solution or workaround.

The end.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use