]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/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
.cross
.sparc_sun_solaris2
;
20 import net
.sf
.antcontrib
.cpptasks
.compiler
.LinkType
;
21 import net
.sf
.antcontrib
.cpptasks
.compiler
.Linker
;
22 import net
.sf
.antcontrib
.cpptasks
.gcc
.AbstractLdLinker
;
24 * Adapter for the 'ld' linker
28 public final class LdLinker
extends AbstractLdLinker
{
29 private static final String
[] discardFiles
= new String
[0];
30 private static final String
[] libtoolObjFiles
= new String
[]{".fo", ".a",
31 ".lib", ".dll", ".so", ".sl"};
32 private static final String
[] objFiles
= new String
[]{".o", ".a", ".lib",
33 ".dll", ".so", ".sl"};
34 private static final LdLinker dllLinker
= new LdLinker(
35 GccCCompiler
.CMD_PREFIX
+ "ld", objFiles
, discardFiles
, "lib",
36 ".so", false, new LdLinker(GccCCompiler
.CMD_PREFIX
+ "ld",
37 objFiles
, discardFiles
, "lib", ".so", true, null));
38 private static final LdLinker instance
= new LdLinker(
39 GccCCompiler
.CMD_PREFIX
+ "ld", objFiles
, discardFiles
, "", "",
41 public static LdLinker
getInstance() {
44 private File
[] libDirs
;
45 private LdLinker(String command
, String
[] extensions
,
46 String
[] ignoredExtensions
, String outputPrefix
,
47 String outputSuffix
, boolean isLibtool
, LdLinker libtoolLinker
) {
48 super(command
, "-version", extensions
, ignoredExtensions
, outputPrefix
,
49 outputSuffix
, isLibtool
, libtoolLinker
);
51 public Linker
getLinker(LinkType type
) {
52 if (type
.isStaticLibrary()) {
53 return GccLibrarian
.getInstance();
55 if (type
.isSharedLibrary()) {