PR binutils/14028
[deliverable/binutils-gdb.git] / ld / sysdep.h
1 /* sysdep.h -- handle host dependencies for the GNU linker
2 Copyright 1995, 1996, 1997, 1999, 2002, 2003, 2005, 2007, 2012
3 Free Software Foundation, Inc.
4
5 This file is part of the GNU Binutils.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
21
22 #ifndef LD_SYSDEP_H
23 #define LD_SYSDEP_H
24
25 #include "config.h"
26
27 #include <stdio.h>
28 #include <sys/types.h>
29 #include <sys/stat.h>
30 #include <stdarg.h>
31
32 #ifdef STRING_WITH_STRINGS
33 #include <string.h>
34 #include <strings.h>
35 #else
36 #ifdef HAVE_STRING_H
37 #include <string.h>
38 #else
39 #ifdef HAVE_STRINGS_H
40 #include <strings.h>
41 #else
42 extern char *strchr ();
43 extern char *strrchr ();
44 #endif
45 #endif
46 #endif
47
48 #ifdef HAVE_STDLIB_H
49 #include <stdlib.h>
50 #endif
51
52 #ifdef HAVE_UNISTD_H
53 #include <unistd.h>
54 #endif
55
56 /* for PATH_MAX */
57 #ifdef HAVE_LIMITS_H
58 #include <limits.h>
59 #endif
60 /* for MAXPATHLEN */
61 #ifdef HAVE_SYS_PARAM_H
62 #include <sys/param.h>
63 #endif
64 #ifdef PATH_MAX
65 # define LD_PATHMAX PATH_MAX
66 #else
67 # ifdef MAXPATHLEN
68 # define LD_PATHMAX MAXPATHLEN
69 # else
70 # define LD_PATHMAX 1024
71 # endif
72 #endif
73
74 #ifdef HAVE_REALPATH
75 # define REALPATH(a,b) realpath (a, b)
76 #else
77 # define REALPATH(a,b) NULL
78 #endif
79
80 #ifdef HAVE_UNISTD_H
81 #include <unistd.h>
82 #endif
83
84 #ifdef USE_BINARY_FOPEN
85 #include "fopen-bin.h"
86 #else
87 #include "fopen-same.h"
88 #endif
89
90 #ifdef HAVE_FCNTL_H
91 #include <fcntl.h>
92 #else
93 #ifdef HAVE_SYS_FILE_H
94 #include <sys/file.h>
95 #endif
96 #endif
97
98 #ifdef HAVE_DLFCN_H
99 #include <dlfcn.h>
100 #endif
101
102 #ifndef O_RDONLY
103 #define O_RDONLY 0
104 #endif
105 #ifndef O_WRONLY
106 #define O_WRONLY 1
107 #endif
108 #ifndef O_RDWR
109 #define O_RDWR 2
110 #endif
111 #ifndef O_ACCMODE
112 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
113 #endif
114 /* Systems that don't already define this, don't need it. */
115 #ifndef O_BINARY
116 #define O_BINARY 0
117 #endif
118
119 #ifndef SEEK_SET
120 #define SEEK_SET 0
121 #endif
122 #ifndef SEEK_CUR
123 #define SEEK_CUR 1
124 #endif
125 #ifndef SEEK_END
126 #define SEEK_END 2
127 #endif
128
129 #if !HAVE_DECL_STRSTR
130 extern char *strstr ();
131 #endif
132
133 #if !HAVE_DECL_FREE
134 extern void free ();
135 #endif
136
137 #if !HAVE_DECL_GETENV
138 extern char *getenv ();
139 #endif
140
141 #if !HAVE_DECL_ENVIRON
142 extern char **environ;
143 #endif
144
145 #endif /* ! defined (LD_SYSDEP_H) */
This page took 0.039917 seconds and 4 git commands to generate.