For$
<!-- begin site header -->
<div id=

Author Topic: -rdynamic for plugins  (Read 14157 times)

Ben S.

  • Newbie
  • *
  • Posts: 25
    • View Profile
-rdynamic for plugins
« on: December 22, 2010, 08:59:51 pm »
I think for windows this switch needs to be changed to -export-all-symbols.  -rdynamic only applies to ELF, not PE.

Also, since the function timeGetTime() is being used, on windows you need to also link -winmm.  I imagine anyone who builds for windows has already figured this out.

And another also, the makefile could also look for pdcurses, not just ncurses.

Edit:  I use mingw btw
« Last Edit: December 22, 2010, 09:05:05 pm by Ben S. »
Unofficial Mineserver builds:
http://www.benschro.com/mineserver

Fador

  • Administrator
  • Full Member
  • *****
  • Posts: 126
    • View Profile
Re: -rdynamic for plugins
« Reply #1 on: December 23, 2010, 12:51:46 am »
well if you got it working, could you provide us a working Makefile for mingw? =)

We could add it as Makefile.mingw or something..

Ben S.

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: -rdynamic for plugins
« Reply #2 on: December 23, 2010, 01:47:01 am »
I posted it here:
http://pastebin.com/J5PqSFy0

2 things to note:
I'm not with the best with makefiles, but my uname with msys returns MINGW_NT-6.1.  I'm not sure how I could make this work for multiple versions for mingw: MINGW*

If someone has pdcurses instead of ncurses on their system, they can use make like this:
make pdcurses=true

I also reordered the linking to be done after the object files on the command line because mingw needs to know all of the symbols beforehand.

Take a look and let me know if i goofed anything up.
Unofficial Mineserver builds:
http://www.benschro.com/mineserver

Ben S.

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: -rdynamic for plugins
« Reply #3 on: December 25, 2010, 03:38:43 am »
Here is another change you should probably make to the Makefile (I know, I should just create a fork, but I don't really have enough time to commit to this project unfortunately).

The way I had it before would only recognize mingw on windows 7.  I saw your use of findstring and adapted it.
Code: [Select]
ifeq ($(findstring MINGW32,$(SYSTEM)),MINGW32)
LFLAGS = -lws2_32 -lwinmm -export-all-symbols
else
LFLAGS = -rdynamic
endif

This looks to me like it will work for different versions of mingw in theory.  Thanks again for accepting my changes.  It got rather tedious to fix it every time.
Unofficial Mineserver builds:
http://www.benschro.com/mineserver