Good question. We can determine the version - __NASM_VER__ expends to a string "0.98.39", __NASM_VERSION_ID__ expands to a (dword) number, there's __NASM_MAJOR__, etc., too. (see "predefined macros")
But I don't think there's a way to determine which build of Nasm is running (the platform Nasm is compiled for). Since any build of Nasm (except "nasm16", which is "deprecated") will emit any output format, this may not be what we actually need to know.
There's __OUTPUT_FORMAT__, which... I'm less sure how to use. I can do:
ver db __NASM_VER__
and Print "ver" and get "0.98.39". but if I try:
fmt db __OUTPUT_FORMAT__
Nasm informs me that the symbol "elf" is not defined. If I do:
fmt db "__OUTPUT_FORMAT__"
it just prints "__OUTPUT_FORMAT__" :(
I *can* do:
%ifidn __OUTPUT_FORMAT__, elf
; some code
%endif
That may be what you're looking for, or can be made to work...
"__OUTPUT_FORMAT__" doesn't seem to be documented anywhere (note to self:...). Hope that's some help.
Best,
Frank