[m-rev.] for review: linked target extension map

Julien Fischer jfischer at opturion.com
Tue Oct 24 12:12:30 AEDT 2023


On Tue, 24 Oct 2023, Zoltan Somogyi wrote:

> Check the extensions for linked target extensions.
> 
> compiler/globals.m:
>     Add to the globals a new structure that maps extension strings
>     (such as ".o", ".a" or ".all_picos) to a representation of what
>     mmc --make target they represent.
> 
> compiler/handle_options.m:
>     Build up this map by processing the values of the options
>
>         object_file_extension
>         pic_object_file_extension
>         executable_extension
>         library_extension
>         shared_library_extension
>
>     checking them for collisions both with each other's values,
>     and with the fixed ".install" extension.

On systems where we do not support shared libraries (or where they have been
explicitly disabled) some of the above will collide since that case we set
shared_library_extension to be library_extension.  For example, Mercury.config
on my Windows system contains:

     --object-file-extension ".o"
     --pic-object-file-extension ".o"
     --executable-file-extension ".exe"
     --shared-library-extension ".a"
     --library-extension ".a"

Julien.


More information about the reviews mailing list