xref: /openbsd/gnu/usr.bin/binutils/ld/sysdep.h (revision 007c2a45)
12159047fSniklas /* sysdep.h -- handle host dependencies for the GNU linker
2*007c2a45Smiod    Copyright 1995, 1996, 1997, 1999, 2002, 2003
3*007c2a45Smiod    Free Software Foundation, Inc.
42159047fSniklas 
52159047fSniklas    This file is part of GLD, the Gnu Linker.
62159047fSniklas 
72159047fSniklas    GLD is free software; you can redistribute it and/or modify
82159047fSniklas    it under the terms of the GNU General Public License as published by
92159047fSniklas    the Free Software Foundation; either version 2, or (at your option)
102159047fSniklas    any later version.
112159047fSniklas 
122159047fSniklas    GLD is distributed in the hope that it will be useful,
132159047fSniklas    but WITHOUT ANY WARRANTY; without even the implied warranty of
142159047fSniklas    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
152159047fSniklas    GNU General Public License for more details.
162159047fSniklas 
172159047fSniklas    You should have received a copy of the GNU General Public License
182159047fSniklas    along with GLD; see the file COPYING.  If not, write to the Free
192159047fSniklas    Software Foundation, 59 Temple Place - Suite 330, Boston, MA
202159047fSniklas    02111-1307, USA.  */
212159047fSniklas 
222159047fSniklas #ifndef LD_SYSDEP_H
232159047fSniklas #define LD_SYSDEP_H
242159047fSniklas 
252159047fSniklas #include "config.h"
262159047fSniklas 
272159047fSniklas #include <stdio.h>
282159047fSniklas #include <sys/types.h>
292159047fSniklas #include <sys/stat.h>
302159047fSniklas 
312159047fSniklas #ifdef HAVE_STRING_H
322159047fSniklas #include <string.h>
332159047fSniklas #else
342159047fSniklas #ifdef HAVE_STRINGS_H
352159047fSniklas #include <strings.h>
362159047fSniklas #else
372159047fSniklas extern char *strchr ();
382159047fSniklas extern char *strrchr ();
392159047fSniklas #endif
402159047fSniklas #endif
412159047fSniklas 
422159047fSniklas #ifdef HAVE_STDLIB_H
432159047fSniklas #include <stdlib.h>
442159047fSniklas #endif
452159047fSniklas 
462159047fSniklas #ifdef HAVE_UNISTD_H
472159047fSniklas #include <unistd.h>
482159047fSniklas #endif
492159047fSniklas 
50c074d1c9Sdrahn /* for PATH_MAX */
51c074d1c9Sdrahn #ifdef HAVE_LIMITS_H
52c074d1c9Sdrahn #include <limits.h>
53c074d1c9Sdrahn #endif
54c074d1c9Sdrahn /* for MAXPATHLEN */
55c074d1c9Sdrahn #ifdef HAVE_SYS_PARAM_H
56c074d1c9Sdrahn #include <sys/param.h>
57c074d1c9Sdrahn #endif
58c074d1c9Sdrahn #ifdef PATH_MAX
59c074d1c9Sdrahn # define LD_PATHMAX PATH_MAX
60c074d1c9Sdrahn #else
61c074d1c9Sdrahn # ifdef MAXPATHLEN
62c074d1c9Sdrahn #  define LD_PATHMAX MAXPATHLEN
63c074d1c9Sdrahn # else
64c074d1c9Sdrahn #  define LD_PATHMAX 1024
65c074d1c9Sdrahn # endif
66c074d1c9Sdrahn #endif
67c074d1c9Sdrahn 
68c074d1c9Sdrahn #ifdef HAVE_REALPATH
69c074d1c9Sdrahn # define REALPATH(a,b) realpath (a, b)
70c074d1c9Sdrahn #else
71c074d1c9Sdrahn # define REALPATH(a,b) NULL
72c074d1c9Sdrahn #endif
73c074d1c9Sdrahn 
742159047fSniklas #ifdef USE_BINARY_FOPEN
752159047fSniklas #include "fopen-bin.h"
762159047fSniklas #else
772159047fSniklas #include "fopen-same.h"
782159047fSniklas #endif
792159047fSniklas 
804361b62eSniklas #ifdef NEED_DECLARATION_STRSTR
814361b62eSniklas extern char *strstr ();
824361b62eSniklas #endif
834361b62eSniklas 
842159047fSniklas #ifdef NEED_DECLARATION_FREE
852159047fSniklas extern void free ();
862159047fSniklas #endif
872159047fSniklas 
88b305b0f1Sespie #ifdef NEED_DECLARATION_GETENV
89b305b0f1Sespie extern char *getenv ();
90b305b0f1Sespie #endif
91b305b0f1Sespie 
92b305b0f1Sespie #ifdef NEED_DECLARATION_ENVIRON
93b305b0f1Sespie extern char **environ;
94b305b0f1Sespie #endif
95b305b0f1Sespie 
962159047fSniklas #endif /* ! defined (LD_SYSDEP_H) */
97