Menu

#19 SHAREPATH support in linux (continued)

closed-rejected
nobody
None
5
2009-12-15
2009-12-13
Glenn Rice
No

I noticed that since my last attempt at getting this fixed you made some changes to the way the build system handles this. The last thing that is needed in order to get the SHAREPATH definition into the code is the attached patch. Without applying this patch to your current svn code the program will not compile. You will receive the error: ‘SHAREPATH’ was not declared in this scope.

Now as to the hard coding of "/usr/local/games/d2x-xl" into main/gamefolders.cpp. You rejected the changes I suggested in the last patch I submitted because it contained changes to this. The way you are doing it breaks linux programing rules. Absolute paths should never be hard coded into a program. All paths should be relative, and defined at compile time. I know you want to have a "standard" location to put data files as this simplifies what you have to say on your web page about where to put data files, but the proper way to do this is with a location relative to the prefix from the configure script. This way the packager or end user compiling his/her own application has control over where any file in the program is installed. It is then the packagers responsibility to tell the target users where the files should go, or the job of the end user who is compiling his/her own code to figure this out. So the correct way to handle this is to define STD_GAMEDIR to be the SHAREPATH (and set szRootFolder to be STD_GAMEDIR on line 751). This of course makes lines 112-114 and 218-219 of main/gamefolders.cpp unnecessary.

Discussion

  • Glenn Rice

    Glenn Rice - 2009-12-14
     
  • karx11erx

    karx11erx - 2009-12-15
    • status: open --> closed-rejected