]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/LdLinker.java
3 * Copyright 2001-2004 The Ant-Contrib project
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package net
.sf
.antcontrib
.cpptasks
.gcc
;
20 import net
.sf
.antcontrib
.cpptasks
.compiler
.LinkType
;
21 import net
.sf
.antcontrib
.cpptasks
.compiler
.Linker
;
23 * Adapter for the 'ld' linker
27 public final class LdLinker
extends AbstractLdLinker
{
28 private static final String
[] discardFiles
= new String
[0];
29 private static final String
[] objFiles
= new String
[]{".o", ".a", ".lib",
30 ".dll", ".so", ".sl"};
31 private static final LdLinker dllLinker
= new LdLinker("ld", objFiles
,
32 discardFiles
, "lib", ".so", false, new LdLinker("ld", objFiles
,
33 discardFiles
, "lib", ".so", true, null));
34 private static final LdLinker instance
= new LdLinker("ld", objFiles
,
35 discardFiles
, "", "", false, null);
36 private static final String
[] libtoolObjFiles
= new String
[]{".fo", ".a",
37 ".lib", ".dll", ".so", ".sl"};
38 public static LdLinker
getInstance() {
41 private File
[] libDirs
;
42 private LdLinker(String command
, String
[] extensions
,
43 String
[] ignoredExtensions
, String outputPrefix
,
44 String outputSuffix
, boolean isLibtool
, LdLinker libtoolLinker
) {
45 super(command
, "-version", extensions
, ignoredExtensions
, outputPrefix
,
46 outputSuffix
, isLibtool
, libtoolLinker
);
48 public Linker
getLinker(LinkType type
) {
49 if (type
.isStaticLibrary()) {
50 return GccLibrarian
.getInstance();
52 if (type
.isSharedLibrary()) {