FWIW, that segfault is fixed! Further, our highly trained and efficient team of developers have added "%ifenv" (and friends), so we can check if an environment variable exists or not before attempting to use it, perhaps using a "default" if not...
%macro import 0-*
%push
%if (%0!=1)
%fatal "usage: import packagename"
%endif
; %xdefine %$incfile %!PROJECTBASEDIR\%{1}\%{1}.inc
%ifenv PROJECTBASEDIR
%xdefine %$incfile %!PROJECTBASEDIR/%{1}.inc
%else
%xdefine %$incfile ~/nasmx/inc/linux/%{1}.inc
%endif
%defstr %$incstr %$incfile
; %fatal "incstr =" %$incstr <-- this prints out the correct path
%include %$incstr
%pop
%endmacro
import foo
diz 1,2 ; crap from foo.inc
Dunno if this would be useful or not, but it's available. Thanks to Cyrill Gorcunov, and to Bryant Keller for the documentation!
Best,
Frank