fortran: Add -fcoarray=shared option to auto-link -lcaf_shmem
The new -fcoarray=shared option provides a convenient shorthand for
the common invocation -fcoarray=lib -lcaf_shmem. The driver transforms
-fcoarray=shared into -fcoarray=lib for the frontend and automatically
appends -lcaf_shmem to the link command. Existing uses of -fcoarray=lib
are unaffected.
* lang.opt (fcoarray=): Add shared enum value; update help text.
* gfortranspec.cc (CAF_SHMEM_LIBRARY): New macro.
(lang_specific_driver): Detect -fcoarray=shared in first pass and
set need_caf_shmem flag. In second pass, transform -fcoarray=shared
to -fcoarray=lib for cc1. Append -lcaf_shmem when need_caf_shmem
is set and linking is active.