Thread: Macro Help
View Single Post
Old February 25, 2015, 22:17   #6
chris
PosChengband Maintainer
 
Join Date: Jan 2008
Posts: 702
chris is on a distinguished road
Chris' Linux Development Q&A Thread

OK, thanks again for tips.

Today I learned that the "escape delay" on the curses port has nothing whatsoever to do with ESCDELAY in curses. Not a thing! It actually has to do with multi-character macros setup in pref-gcu.pref to map the multi-character sequences that curses generates for certain keystrokes. Like, you press '2' on the num pad and curses sends \e[B (3 calls to getch()). pref-gcu.pref sets up a macro to translate this back to '2' for the game engine. Now, when the user presses \e (say, to dismiss a menu), our code (not curses!) is pausing to see if the user really wants to type \e[B by hand! Fun stuff, I just had to share

Anyway, today's question relates to setting up compiler options in the build. For instance, if I want -fsanitize=address to be set, then this should only happen for me, not for other people who download and compile on linux (as they may use an older gcc or some other compiler). What I came up with was doing a
Code:
./configure CFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address --with-no-install
which is a bit cumbersome. Is there a better way?

On a similar note, sometimes I want a debug build (-O0 -g) and sometimes not (-O3). I gather that changing src/Makefile (which is under version control) is not the best way to do this ... Help?

Thanks in advance!
chris is offline   Reply With Quote