View Issue Details

IDProjectCategoryView StatusLast Update
0001097Spring engineGeneralpublic2008-10-16 17:39
ReporterAMDmi3 Assigned ToAuswaschbar  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version0.77b2+svn 
Fixed in Version0.77b4+svn 
Summary0001097: [PATCH] Bunch of compatibility tweaks
DescriptionHere's bunch of patches I've used to build spring 0.77b2 on FreeBSD. It would be good to merge them into the sourcetree, and I believe it will improve spring portability in general.

Summary of changes:
* TestCXXAcceptsVisibilityFlag.cmake has a test for whether gcc supports -fvisibility=hidden, but does not have test for -fvisibility=default. The latter is used as is in CMakeLists.txt, and this would fail on old gcc (in my case, legacy 6.x branch of FreeBSD which still uses gcc 3.4), so add support for VISIBILITY_DEFAULT to TestCXXAcceptsVisibilityFlag and fix CMakeLists.txt
* Add BEFORE keyword for spring internal include dirs in INCLUDE_DIRECTORIES here and there. Thus, build won't erroneously pick up some systemwide installed libraries (in by case that was luabind).
* Change malloc.h to stdlib.h, as the former is deprecated
* undef isnumber in rts/Lua/LuaUtils.h. Not sure why it is defined in my case though...
* Change library names to macros here and there. This way spring builds without need to specify additional library search paths (/usr/local/include in my case). cmake detects all libraries perfectly.
TagsNo tags attached.
Attached Files
spring.patch (Attachment missing)
spring.1.patch (Attachment missing)
spring.2.patch (Attachment missing)
Checked infolog.txt for Errors

Activities

imbaczek

2008-10-10 14:18

reporter   ~0002758

patches really welcome, AFAIK no dev has FreeBSD to test spring on.

AMDmi3

2008-10-10 14:26

reporter   ~0002760

You can leave testing to me :)

Kloot

2008-10-10 14:30

developer   ~0002761

beware regarding your first change though, Spring binaries compiled with gcc versions < 4.0 will not sync in multiplayer against the official builds so making compilation with it easier perhaps isn't a good idea (more potential ghost desync reports and such) :)

AMDmi3

2008-10-10 14:50

reporter   ~0002762

Then I think explicit check for gcc version or specific feature should be added to cmake and warning displayed.
In case of FreeBSD port, it can be made so Spring is always built with gcc42 (which is build from ports too if not present in base system), so FreeBSD-wise this is not a problem.

Auswaschbar

2008-10-12 00:54

reporter   ~0002799

Applied most of the stuff, along with some modifications to not to break win32 build.

AMDmi3

2008-10-12 15:53

reporter   ~0002814

Some bits are still missing.

AMDmi3

2008-10-12 15:57

reporter   ~0002815

* tools/unitsync/CMakeLists.txt: libraries
* rts/Lua/LuaUtils.h: undef isnumber
* CMakeLists.txt: INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})

If the first issue breaks win32 build, I think IF(MINGW) should be used like in other places.

The second one is questionable, but on FreeBSD, isnumber is defined as a macro for some (I guess compatibility) reason, so it's safer to undef it.

The third one should be clear.

AMDmi3

2008-10-15 17:16

reporter   ~0002925

Those are the last bits, main thing is rts/lib/CMakeLists.txt.
Now used SVN to be sure not to miss anything.

Auswaschbar

2008-10-16 16:21

reporter   ~0002958

Applied everything but the fvisibility=default, because of the reasons kloot gave.

AMDmi3

2008-10-16 17:39

reporter   ~0002960

Thanks a lot!

Though it seems illogical to me that there are checks for -fvisibility=hidden and -fvisibility-inlines-hidden (which seem to help building with gcc34), and still there's hardcoded -fvisibility=default just to break build on that very gcc34.

Issue History

Date Modified Username Field Change
2008-10-10 12:34 AMDmi3 New Issue
2008-10-10 12:34 AMDmi3 File Added: spring.patch
2008-10-10 14:18 imbaczek Note Added: 0002758
2008-10-10 14:26 AMDmi3 Note Added: 0002760
2008-10-10 14:30 Kloot Note Added: 0002761
2008-10-10 14:50 AMDmi3 Note Added: 0002762
2008-10-10 15:37 tvo Product Version => 0.77b2+svn
2008-10-10 15:37 tvo Summary Bunch of compatibility tweaks => [PATCH] Bunch of compatibility tweaks
2008-10-12 00:54 Auswaschbar Status new => resolved
2008-10-12 00:54 Auswaschbar Resolution open => fixed
2008-10-12 00:54 Auswaschbar Assigned To => Auswaschbar
2008-10-12 00:54 Auswaschbar Note Added: 0002799
2008-10-12 15:53 AMDmi3 Status resolved => feedback
2008-10-12 15:53 AMDmi3 Resolution fixed => reopened
2008-10-12 15:53 AMDmi3 Note Added: 0002814
2008-10-12 15:57 AMDmi3 Note Added: 0002815
2008-10-12 15:58 AMDmi3 File Added: spring.1.patch
2008-10-15 17:16 AMDmi3 Note Added: 0002925
2008-10-15 17:16 AMDmi3 File Added: spring.2.patch
2008-10-16 16:21 Auswaschbar Status feedback => resolved
2008-10-16 16:21 Auswaschbar Fixed in Version => 0.77b4+svn
2008-10-16 16:21 Auswaschbar Resolution reopened => fixed
2008-10-16 16:21 Auswaschbar Note Added: 0002958
2008-10-16 17:39 AMDmi3 Status resolved => closed
2008-10-16 17:39 AMDmi3 Note Added: 0002960