I noticed there was an earlier patch regarding this issue, but this hasn't been fixed in the code yet, and this patch gives the correct way to integrate paths into source files using autotools. The way the current configure.ac sets up the SHAREPATH variable won't work. "$(datadir)/d2x-xl" will not be expanded as it is not filtered through a shell.
This is not the way SHAREPATH handling is intended by me either. gamefolders.cpp first checks whether it finds the game data in the folder specified by SHAREPATH. If yes, this will be the Descent data folder. If not, it will use the default folder defined by STD_GAMEDIR. You are effectively removing that default folder.
I see what you are saying. The rest of the patch should be applied though. Otherwise you may as well remove the SHAREPATH completely from your code as it is completely useless as it is.