/[gentoo-alt]/trunk/toolchain-prefix-wrapper/ld/darwinplugin.c
Gentoo

Contents of /trunk/toolchain-prefix-wrapper/ld/darwinplugin.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1591 - (show annotations) (download) (as text)
Fri Nov 2 10:58:02 2007 UTC (6 years, 5 months ago) by haubi
File MIME type: text/x-csrc
File size: 1077 byte(s)
initial import of toolchain-prefix-wrapper

1 /*
2 * Copyright 2007 Gentoo Foundation
3 * Distributed under the terms of the GNU General Public License v2
4 * Author: Michael Haubenwallner <haubi@gentoo.org>
5 */
6
7 #include <config.h>
8
9 #include "darwinplugin.h"
10
11 #include <stdlib.h>
12
13 #if defined(__cplusplus)
14 extern "C" {
15 #endif
16
17 StringList* darwinplugin(StringList *argList, StringList *userLibpathList, StringList *sysLibpathList)
18 {
19 int err;
20 StringList *newArgList = NULL;
21
22 do { /* dummy loop */
23 err = 1;
24
25 /* keep argv[0] */
26 newArgList = StringListCreate(argList, 0, 1);
27 if (newArgList == NULL) break;
28
29 if (StringListAppendConcat(newArgList, "-search_paths_first", 19, NULL) < 0) break;
30
31 /* keep argv[1] ... argv[n] */
32 if (StringListAppendList(newArgList, argList, 1, -1) < 0)
33 break;
34
35 /* append sys libpath's with "-L" */
36 if (StringListAppendListModify(newArgList, sysLibpathList, 0, -1, "-L", 2, NULL, 0) < 0)
37 break;
38
39 err = 0;
40 } while(0); /* end dummy loop */
41
42 if (err && newArgList != NULL) newArgList = StringListDestroy(newArgList);
43
44 return newArgList;
45 }
46
47 #if defined(__cplusplus)
48 }
49 #endif

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.20