Rev 5217 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5217 | Rev 5812 | ||
---|---|---|---|
1 | /* sysdep.h -- handle host dependencies for binutils |
1 | /* sysdep.h -- handle host dependencies for binutils |
2 | Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
2 | Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
3 | 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2012 |
3 | 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2012 |
4 | Free Software Foundation, Inc. |
4 | Free Software Foundation, Inc. |
5 | 5 | ||
6 | This file is part of GNU Binutils. |
6 | This file is part of GNU Binutils. |
7 | 7 | ||
8 | This program is free software; you can redistribute it and/or modify |
8 | This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by |
9 | it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; either version 3 of the License, or |
10 | the Free Software Foundation; either version 3 of the License, or |
11 | (at your option) any later version. |
11 | (at your option) any later version. |
12 | 12 | ||
13 | This program is distributed in the hope that it will be useful, |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
16 | GNU General Public License for more details. |
17 | 17 | ||
18 | You should have received a copy of the GNU General Public License |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ |
20 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ |
21 | 21 | ||
22 | #ifndef _BIN_SYSDEP_H |
22 | #ifndef _BIN_SYSDEP_H |
23 | #define _BIN_SYSDEP_H |
23 | #define _BIN_SYSDEP_H |
24 | 24 | ||
25 | #include "alloca-conf.h" |
25 | #include "alloca-conf.h" |
26 | #include "ansidecl.h" |
26 | #include "ansidecl.h" |
27 | #include |
27 | #include |
28 | #include |
28 | #include |
29 | 29 | ||
30 | #include "bfdver.h" |
30 | #include "bfdver.h" |
31 | 31 | ||
32 | #include |
32 | #include |
33 | 33 | ||
34 | #ifdef USE_BINARY_FOPEN |
34 | #ifdef USE_BINARY_FOPEN |
35 | #include "fopen-bin.h" |
35 | #include "fopen-bin.h" |
36 | #else |
36 | #else |
37 | #include "fopen-same.h" |
37 | #include "fopen-same.h" |
38 | #endif |
38 | #endif |
39 | 39 | ||
40 | #include |
40 | #include |
41 | #ifndef errno |
41 | #ifndef errno |
42 | extern int errno; |
42 | extern int errno; |
43 | #endif |
43 | #endif |
44 | 44 | ||
45 | #ifdef HAVE_UNISTD_H |
45 | #ifdef HAVE_UNISTD_H |
46 | #include |
46 | #include |
47 | #endif |
47 | #endif |
48 | 48 | ||
49 | #ifdef STRING_WITH_STRINGS |
49 | #ifdef STRING_WITH_STRINGS |
50 | #include |
50 | #include |
51 | #include |
51 | #include |
52 | #else |
52 | #else |
53 | #ifdef HAVE_STRING_H |
53 | #ifdef HAVE_STRING_H |
54 | #include |
54 | #include |
55 | #else |
55 | #else |
56 | #ifdef HAVE_STRINGS_H |
56 | #ifdef HAVE_STRINGS_H |
57 | #include |
57 | #include |
58 | #else |
58 | #else |
59 | extern char *strchr (); |
59 | extern char *strchr (); |
60 | extern char *strrchr (); |
60 | extern char *strrchr (); |
61 | #endif |
61 | #endif |
62 | #endif |
62 | #endif |
63 | #endif |
63 | #endif |
- | 64 | ||
64 | 65 | ||
65 | #ifdef HAVE_STDLIB_H |
66 | #ifdef HAVE_STDLIB_H |
66 | #include |
67 | #include |
67 | #endif |
68 | #endif |
68 | 69 | ||
69 | #ifdef HAVE_FCNTL_H |
70 | #ifdef HAVE_FCNTL_H |
70 | #include |
71 | #include |
71 | #else |
72 | #else |
72 | #ifdef HAVE_SYS_FILE_H |
73 | #ifdef HAVE_SYS_FILE_H |
73 | #include |
74 | #include |
74 | #endif |
75 | #endif |
75 | #endif |
76 | #endif |
76 | 77 | ||
77 | #ifdef HAVE_SYS_STAT_H |
78 | #ifdef HAVE_SYS_STAT_H |
78 | #include |
79 | #include |
79 | #endif |
80 | #endif |
80 | 81 | ||
81 | #include "binary-io.h" |
82 | #include "binary-io.h" |
82 | 83 | ||
83 | #if !HAVE_DECL_STPCPY |
84 | #if !HAVE_DECL_STPCPY |
84 | extern char *stpcpy (char *, const char *); |
85 | extern char *stpcpy (char *, const char *); |
85 | #endif |
86 | #endif |
86 | 87 | ||
87 | #if !HAVE_DECL_STRSTR |
88 | #if !HAVE_DECL_STRSTR |
88 | extern char *strstr (); |
89 | extern char *strstr (); |
89 | #endif |
90 | #endif |
90 | 91 | ||
91 | #ifdef HAVE_SBRK |
92 | #ifdef HAVE_SBRK |
92 | #if !HAVE_DECL_SBRK |
93 | #if !HAVE_DECL_SBRK |
93 | extern char *sbrk (); |
94 | extern char *sbrk (); |
94 | #endif |
95 | #endif |
95 | #endif |
96 | #endif |
96 | 97 | ||
97 | #if !HAVE_DECL_GETENV |
98 | #if !HAVE_DECL_GETENV |
98 | extern char *getenv (); |
99 | extern char *getenv (); |
99 | #endif |
100 | #endif |
100 | 101 | ||
101 | #if !HAVE_DECL_ENVIRON |
102 | #if !HAVE_DECL_ENVIRON |
102 | extern char **environ; |
103 | extern char **environ; |
103 | #endif |
104 | #endif |
104 | 105 | ||
105 | #if !HAVE_DECL_FPRINTF |
106 | #if !HAVE_DECL_FPRINTF |
106 | extern int fprintf (FILE *, const char *, ...); |
107 | extern int fprintf (FILE *, const char *, ...); |
107 | #endif |
108 | #endif |
108 | 109 | ||
109 | #if !HAVE_DECL_SNPRINTF |
110 | #if !HAVE_DECL_SNPRINTF |
110 | extern int snprintf(char *, size_t, const char *, ...); |
111 | extern int snprintf(char *, size_t, const char *, ...); |
111 | #endif |
112 | #endif |
112 | 113 | ||
113 | #if !HAVE_DECL_VSNPRINTF |
114 | #if !HAVE_DECL_VSNPRINTF |
114 | extern int vsnprintf(char *, size_t, const char *, va_list); |
115 | extern int vsnprintf(char *, size_t, const char *, va_list); |
115 | #endif |
116 | #endif |
116 | 117 | ||
117 | #ifndef O_RDONLY |
118 | #ifndef O_RDONLY |
118 | #define O_RDONLY 0 |
119 | #define O_RDONLY 0 |
119 | #endif |
120 | #endif |
120 | 121 | ||
121 | #ifndef O_RDWR |
122 | #ifndef O_RDWR |
122 | #define O_RDWR 2 |
123 | #define O_RDWR 2 |
123 | #endif |
124 | #endif |
124 | 125 | ||
125 | #ifndef SEEK_SET |
126 | #ifndef SEEK_SET |
126 | #define SEEK_SET 0 |
127 | #define SEEK_SET 0 |
127 | #endif |
128 | #endif |
128 | #ifndef SEEK_CUR |
129 | #ifndef SEEK_CUR |
129 | #define SEEK_CUR 1 |
130 | #define SEEK_CUR 1 |
130 | #endif |
131 | #endif |
131 | #ifndef SEEK_END |
132 | #ifndef SEEK_END |
132 | #define SEEK_END 2 |
133 | #define SEEK_END 2 |
133 | #endif |
134 | #endif |
134 | 135 | ||
135 | #ifdef HAVE_LOCALE_H |
136 | #ifdef HAVE_LOCALE_H |
136 | # ifndef ENABLE_NLS |
137 | # ifndef ENABLE_NLS |
137 | /* The Solaris version of locale.h always includes libintl.h. If we have |
138 | /* The Solaris version of locale.h always includes libintl.h. If we have |
138 | been configured with --disable-nls then ENABLE_NLS will not be defined |
139 | been configured with --disable-nls then ENABLE_NLS will not be defined |
139 | and the dummy definitions of bindtextdomain (et al) below will conflict |
140 | and the dummy definitions of bindtextdomain (et al) below will conflict |
140 | with the defintions in libintl.h. So we define these values to prevent |
141 | with the defintions in libintl.h. So we define these values to prevent |
141 | the bogus inclusion of libintl.h. */ |
142 | the bogus inclusion of libintl.h. */ |
142 | # define _LIBINTL_H |
143 | # define _LIBINTL_H |
143 | # define _LIBGETTEXT_H |
144 | # define _LIBGETTEXT_H |
144 | # endif |
145 | # endif |
145 | # include |
146 | # include |
146 | #endif |
147 | #endif |
147 | 148 | ||
148 | #ifdef ENABLE_NLS |
149 | #ifdef ENABLE_NLS |
149 | # include |
150 | # include |
150 | # define _(String) gettext (String) |
151 | # define _(String) gettext (String) |
151 | # ifdef gettext_noop |
152 | # ifdef gettext_noop |
152 | # define N_(String) gettext_noop (String) |
153 | # define N_(String) gettext_noop (String) |
153 | # else |
154 | # else |
154 | # define N_(String) (String) |
155 | # define N_(String) (String) |
155 | # endif |
156 | # endif |
156 | #else |
157 | #else |
157 | # define gettext(Msgid) (Msgid) |
158 | # define gettext(Msgid) (Msgid) |
158 | # define dgettext(Domainname, Msgid) (Msgid) |
159 | # define dgettext(Domainname, Msgid) (Msgid) |
159 | # define dcgettext(Domainname, Msgid, Category) (Msgid) |
160 | # define dcgettext(Domainname, Msgid, Category) (Msgid) |
160 | # define textdomain(Domainname) while (0) /* nothing */ |
161 | # define textdomain(Domainname) while (0) /* nothing */ |
161 | # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ |
162 | # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ |
162 | # define _(String) (String) |
163 | # define _(String) (String) |
163 | # define N_(String) (String) |
164 | # define N_(String) (String) |
164 | #endif |
165 | #endif |
165 | 166 | ||
166 | /* Used by ar.c and objcopy.c. */ |
167 | /* Used by ar.c and objcopy.c. */ |
167 | #define BUFSIZE 8192 |
168 | #define BUFSIZE 8192 |
168 | 169 | ||
169 | /* For PATH_MAX. */ |
170 | /* For PATH_MAX. */ |
170 | #ifdef HAVE_LIMITS_H |
171 | #ifdef HAVE_LIMITS_H |
171 | #include |
172 | #include |
172 | #endif |
173 | #endif |
173 | 174 | ||
174 | #ifndef PATH_MAX |
175 | #ifndef PATH_MAX |
175 | /* For MAXPATHLEN. */ |
176 | /* For MAXPATHLEN. */ |
176 | # ifdef HAVE_SYS_PARAM_H |
177 | # ifdef HAVE_SYS_PARAM_H |
177 | # include |
178 | # include |
178 | # endif |
179 | # endif |
179 | # ifndef PATH_MAX |
180 | # ifndef PATH_MAX |
180 | # ifdef MAXPATHLEN |
181 | # ifdef MAXPATHLEN |
181 | # define PATH_MAX MAXPATHLEN |
182 | # define PATH_MAX MAXPATHLEN |
182 | # else |
183 | # else |
183 | # define PATH_MAX 1024 |
184 | # define PATH_MAX 1024 |
184 | # endif |
185 | # endif |
185 | # endif |
186 | # endif |
186 | #endif |
187 | #endif |
187 | 188 | ||
188 | #endif /* _BIN_SYSDEP_H */ |
189 | #endif /* _BIN_SYSDEP_H */ |