Issue #17095: Fix Modules/Setup *shared* support.
Original patch by Thomas Wouters.