| 1 | /* sysdep.h -- handle host dependencies for the GNU linker | 
|---|
| 2 | Copyright 1995, 1996, 1997, 1999, 2002 Free Software Foundation, Inc. | 
|---|
| 3 |  | 
|---|
| 4 | This file is part of GLD, the Gnu Linker. | 
|---|
| 5 |  | 
|---|
| 6 | GLD is free software; you can redistribute it and/or modify | 
|---|
| 7 | it under the terms of the GNU General Public License as published by | 
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 9 | any later version. | 
|---|
| 10 |  | 
|---|
| 11 | GLD is distributed in the hope that it will be useful, | 
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 14 | GNU General Public License for more details. | 
|---|
| 15 |  | 
|---|
| 16 | You should have received a copy of the GNU General Public License | 
|---|
| 17 | along with GLD; see the file COPYING.  If not, write to the Free | 
|---|
| 18 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | 
|---|
| 19 | 02111-1307, USA.  */ | 
|---|
| 20 |  | 
|---|
| 21 | #ifndef LD_SYSDEP_H | 
|---|
| 22 | #define LD_SYSDEP_H | 
|---|
| 23 |  | 
|---|
| 24 | #include "ansidecl.h" | 
|---|
| 25 |  | 
|---|
| 26 | #include "config.h" | 
|---|
| 27 |  | 
|---|
| 28 | #include <stdio.h> | 
|---|
| 29 | #include <sys/types.h> | 
|---|
| 30 | #include <sys/stat.h> | 
|---|
| 31 |  | 
|---|
| 32 | #ifdef HAVE_STRING_H | 
|---|
| 33 | #include <string.h> | 
|---|
| 34 | #else | 
|---|
| 35 | #ifdef HAVE_STRINGS_H | 
|---|
| 36 | #include <strings.h> | 
|---|
| 37 | #else | 
|---|
| 38 | extern char *strchr (); | 
|---|
| 39 | extern 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 |  | 
|---|
| 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 |  | 
|---|
| 75 | #ifdef USE_BINARY_FOPEN | 
|---|
| 76 | #include "fopen-bin.h" | 
|---|
| 77 | #else | 
|---|
| 78 | #include "fopen-same.h" | 
|---|
| 79 | #endif | 
|---|
| 80 |  | 
|---|
| 81 | #ifdef NEED_DECLARATION_STRSTR | 
|---|
| 82 | extern char *strstr (); | 
|---|
| 83 | #endif | 
|---|
| 84 |  | 
|---|
| 85 | #ifdef NEED_DECLARATION_FREE | 
|---|
| 86 | extern void free (); | 
|---|
| 87 | #endif | 
|---|
| 88 |  | 
|---|
| 89 | #ifdef NEED_DECLARATION_GETENV | 
|---|
| 90 | extern char *getenv (); | 
|---|
| 91 | #endif | 
|---|
| 92 |  | 
|---|
| 93 | #ifdef NEED_DECLARATION_ENVIRON | 
|---|
| 94 | extern char **environ; | 
|---|
| 95 | #endif | 
|---|
| 96 |  | 
|---|
| 97 | #endif /* ! defined (LD_SYSDEP_H) */ | 
|---|