sim: headers: use abs_srcdir to find helper scripts
[deliverable/binutils-gdb.git] / ld / sysdep.h
CommitLineData
252b5132 1/* sysdep.h -- handle host dependencies for the GNU linker
aa820537 2 Copyright 1995, 1996, 1997, 1999, 2002, 2003, 2005, 2007
1579bae1 3 Free Software Foundation, Inc.
252b5132 4
f96b4a7b 5 This file is part of the GNU Binutils.
252b5132 6
f96b4a7b 7 This program is free software; you can redistribute it and/or modify
252b5132 8 it under the terms of the GNU General Public License as published by
f96b4a7b
NC
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
252b5132 11
f96b4a7b 12 This program is distributed in the hope that it will be useful,
252b5132
RH
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
f96b4a7b
NC
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. */
252b5132
RH
21
22#ifndef LD_SYSDEP_H
23#define LD_SYSDEP_H
24
252b5132
RH
25#include "config.h"
26
27#include <stdio.h>
28#include <sys/types.h>
29#include <sys/stat.h>
5d3236ee 30#include <stdarg.h>
252b5132
RH
31
32#ifdef HAVE_STRING_H
33#include <string.h>
34#else
35#ifdef HAVE_STRINGS_H
36#include <strings.h>
37#else
38extern char *strchr ();
39extern char *strrchr ();
40#endif
41#endif
42
43#ifdef HAVE_STDLIB_H
44#include <stdlib.h>
45#endif
46
47#ifdef HAVE_UNISTD_H
48#include <unistd.h>
49#endif
50
939ba9d0
NC
51/* for PATH_MAX */
52#ifdef HAVE_LIMITS_H
53#include <limits.h>
54#endif
55/* for MAXPATHLEN */
56#ifdef HAVE_SYS_PARAM_H
57#include <sys/param.h>
58#endif
59#ifdef PATH_MAX
60# define LD_PATHMAX PATH_MAX
61#else
62# ifdef MAXPATHLEN
63# define LD_PATHMAX MAXPATHLEN
64# else
65# define LD_PATHMAX 1024
66# endif
67#endif
68
69#ifdef HAVE_REALPATH
70# define REALPATH(a,b) realpath (a, b)
71#else
72# define REALPATH(a,b) NULL
73#endif
74
5d3236ee
DK
75#ifdef HAVE_UNISTD_H
76#include <unistd.h>
77#endif
78
252b5132
RH
79#ifdef USE_BINARY_FOPEN
80#include "fopen-bin.h"
81#else
82#include "fopen-same.h"
83#endif
84
5d3236ee
DK
85#ifdef HAVE_FCNTL_H
86#include <fcntl.h>
87#else
88#ifdef HAVE_SYS_FILE_H
89#include <sys/file.h>
90#endif
91#endif
92
3917d5d5 93#ifdef HAVE_DLFCN_H
5d3236ee
DK
94#include <dlfcn.h>
95#endif
96
97#ifndef O_RDONLY
98#define O_RDONLY 0
99#endif
100#ifndef O_WRONLY
101#define O_WRONLY 1
102#endif
103#ifndef O_RDWR
104#define O_RDWR 2
105#endif
106#ifndef O_ACCMODE
107#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
108#endif
109/* Systems that don't already define this, don't need it. */
110#ifndef O_BINARY
111#define O_BINARY 0
112#endif
113
114#ifndef SEEK_SET
115#define SEEK_SET 0
116#endif
117#ifndef SEEK_CUR
118#define SEEK_CUR 1
119#endif
120#ifndef SEEK_END
121#define SEEK_END 2
122#endif
123
502bdb00 124#if !HAVE_DECL_STRSTR
252b5132
RH
125extern char *strstr ();
126#endif
127
502bdb00 128#if !HAVE_DECL_FREE
252b5132
RH
129extern void free ();
130#endif
131
502bdb00 132#if !HAVE_DECL_GETENV
252b5132
RH
133extern char *getenv ();
134#endif
135
502bdb00 136#if !HAVE_DECL_ENVIRON
252b5132
RH
137extern char **environ;
138#endif
139
140#endif /* ! defined (LD_SYSDEP_H) */
This page took 0.580467 seconds and 4 git commands to generate.