amagnasco / xwpe

Upload of an abandoned ncurses-based programming environment
http://www.identicalsoftware.com/xwpe/
GNU General Public License v2.0
31 stars 7 forks source link

LIBRARY_DIR hard coded as /usr/local/lib/xwpe if not defined #55

Closed gbonnema closed 7 years ago

gbonnema commented 7 years ago

in unixkeys.h I found a conditional define for LIBRARY_DIR that I would not expect in the program code. I still have to find out what it does exactly, but it seems that xwpe stores data in that directory.

I have to delve some deeper, but I am pretty sure, this should not be hard code, but part of the generation process of the autotools.

Let me know whether you agree,

EDIT: Correction. In the old Makefile.in this was coded in as $(LIBDIR)/xwpe. Nonetheless, I think directories or files should not be hardcoded into source. Better to fail gracefully than to hardcode a file or directory. Do you agree?

gbonnema commented 7 years ago

I solved this issue in the branch autotools (branch not pulled yet) using standard autotools methods. In stead of the hardcoded library (was set to "/usr/local/lib/xwpe" in the code), I just do a preprocessor error if LIBRARY_DIR is not defined. The value should always come from a userdefined value or the default out of the Makefile.am and configure.ac.