Re: module(7) vs KERN_AS (Re: HEADS-UP: Recent atari install floppy overflow)

Rin Okuyama <[email protected]> Sat, 22 Sep 2018 21:44:40 +0900
Newsgroups gmane.os.netbsd.current,gmane.os.netbsd.devel.kernel,gmane.os.netbsd.ports.atari
Message-ID <[email protected]>
> On 2018/09/19 15:57, Rin Okuyama wrote:
>> Hi,
>>
>> Currently, KERN_AS is set in Makefile.arch. However, it should be
>> determined on whether module(7) is enabled or not, for *all* ports,
>> something like
>>
>>    OPT_MODULAR=    %MODULAR%
>>    .if !empty(OPT_MODULAR)
>>    KERN_AS=    obj
>>    .else
>>    KERN_AS=    library
>>    .endif
>>
>> Therefore, it is not a good idea to have the common segment of
>> codes above in all Makefile.arch. We would have three options:
>>
>> (1) use sys/conf/Makefile.conf
>>
>> (2) add %MODULAR directive and emitmodular() function in config(1)
>>
>> (3) set OPT_MODULAR in Makefile.arch, and change a default value for
>> KERN_AS depending on its value in sys/lib/libkern/Makefile.inc
>>
>> (1) does not work since %MODULAR% is not expanded if it is in
>> sys/conf/Makefile.conf. And (2) seems too much for me. Therefore,
>> I propose (3) as a compromise. Please find the attached patch (MD
>> part is only for amd64 as an example).

Committed:
http://mail-index.netbsd.org/source-changes/2018/09/22/msg099343.html

Thanks,
rin