         case directory(String)
     }
     
-    private func createModuleMap(inDir wd: String, type: UmbrellaType) throws {
+    private func createModuleMap(inDir wd: String, type: UmbrellaType, modulemapStyle: ModuleMapStyle) throws {
         try Utility.makeDirectories(wd)
         let moduleMapFile = Path.join(wd, self.moduleMap)
         let moduleMap = try fopen(moduleMapFile, mode: .write)
         defer { moduleMap.closeFile() }
         
-        var output = "module \(c99name) {\n"
+        var output = ""
+        if let qualifier = modulemapStyle.moduleDeclQualifier {
+            output += qualifier + " "
+        }
+        output += "module \(c99name) {\n"
         switch type {
         case .header(let header):
             output += "    umbrella header \"\(header)\"\n"
         case .directory(let path):
             output += "    umbrella \"\(path)\"\n"
         }
-        output += "    link \"\(c99name)\"\n"
+        output += "    \(modulemapStyle.linkDeclFlag) \"\(c99name)\"\n"
         output += "    export *\n"
         output += "}\n"
 

        let umbrellaHeader = Path.join(includeDir, c99name, "\(c99name).h")
        if umbrellaHeader.isFile {
            guard dirs.count == 1 && files.isEmpty else { throw ModuleMapError.unsupportedIncludeLayoutForModule(name) }
            try createModuleMap(inDir: wd, type: .header(umbrellaHeader))
            return
        }
        diagnoseInvalidUmbrellaHeader(Path.join(includeDir, c99name))

        try createModuleMap(inDir: wd, type: .directory(includeDir))
    }

    ///warn user if in case module name and c99name are different and there a `name.h` umbrella header

    ///when building swift modules in `XccFlags(prefix: String)`
    ///there shouldn't be need to redo this there but is difficult 
    ///in current architecture
    public func generateModuleMap(inDir wd: String, modulemapStyle: ModuleMapStyle = .library) throws {
        precondition(wd.isAbsolute)
        
        ///Return if module map is already present
