Makefile.in (OBJS, PROTO_OBJS): Remove getpwd.o.
* Makefile.in (OBJS, PROTO_OBJS): Remove getpwd.o. (getpwd.o): Remove target. * getpwd.c: Delete file. Its in libiberty now. * dbxout.c (getpwd): Don't prototype. * dwarf2out.c (getpwd): Likewise * dwarfout.c (getpwd): Likewise * final.c (getpwd): Likewise. * protoize.c (getpwd): Likewise. From-SVN: r28999
This commit is contained in:
parent
1fdf491e50
commit
a2957e1d3e
|
@ -1,3 +1,16 @@
|
|||
Mon Aug 30 20:56:08 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* Makefile.in (OBJS, PROTO_OBJS): Remove getpwd.o.
|
||||
(getpwd.o): Remove target.
|
||||
|
||||
* getpwd.c: Delete file. Its in libiberty now.
|
||||
|
||||
* dbxout.c (getpwd): Don't prototype.
|
||||
* dwarf2out.c (getpwd): Likewise
|
||||
* dwarfout.c (getpwd): Likewise
|
||||
* final.c (getpwd): Likewise.
|
||||
* protoize.c (getpwd): Likewise.
|
||||
|
||||
Mon Aug 30 20:21:34 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* cse.c: (fold_rtx): Cast to HOST_WIDE_INT in left shift.
|
||||
|
|
|
@ -667,7 +667,7 @@ OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
|
|||
regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \
|
||||
insn-peep.o reorg.o haifa-sched.o final.o recog.o reg-stack.o \
|
||||
insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o lcm.o \
|
||||
profile.o insn-attrtab.o $(out_object_file) getpwd.o $(EXTRA_OBJS) convert.o \
|
||||
profile.o insn-attrtab.o $(out_object_file) $(EXTRA_OBJS) convert.o \
|
||||
mbchar.o dyn-string.o splay-tree.o graph.o sbitmap.o resource.o hash.o lists.o
|
||||
|
||||
# GEN files are listed separately, so they can be built before doing parallel
|
||||
|
@ -1504,7 +1504,6 @@ emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
|
|||
function.h $(REGS_H) insn-config.h $(RECOG_H) real.h \
|
||||
$(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h
|
||||
real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.h
|
||||
getpwd.o : getpwd.c $(CONFIG_H) system.h
|
||||
|
||||
integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
|
||||
integrate.h insn-flags.h insn-config.h $(EXPR_H) real.h $(REGS_H) \
|
||||
|
@ -2007,7 +2006,7 @@ cppinit.o: cppinit.c $(CONFIG_H) cpplib.h intl.h system.h \
|
|||
|
||||
proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
|
||||
|
||||
PROTO_OBJS = getpwd.o intl.o version.o
|
||||
PROTO_OBJS = intl.o version.o
|
||||
|
||||
protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS)
|
||||
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS)
|
||||
|
|
|
@ -136,8 +136,6 @@ Boston, MA 02111-1307, USA. */
|
|||
#endif
|
||||
#endif
|
||||
|
||||
char *getpwd ();
|
||||
|
||||
/* Typical USG systems don't have stab.h, and they also have
|
||||
no use for DBX-format debugging info. */
|
||||
|
||||
|
|
|
@ -2022,8 +2022,6 @@ dwarf2out_frame_finish ()
|
|||
/* And now, the support for symbolic debugging information. */
|
||||
#ifdef DWARF2_DEBUGGING_INFO
|
||||
|
||||
extern char *getpwd PROTO((void));
|
||||
|
||||
/* NOTE: In the comments in this file, many references are made to
|
||||
"Debugging Information Entries". This term is abbreviated as `DIE'
|
||||
throughout the remainder of this file. */
|
||||
|
|
|
@ -50,8 +50,6 @@ extern time_t time PROTO ((time_t *)); /* FIXME: use NEED_DECLARATION_TIME */
|
|||
# define assert(e) do { if (! (e)) abort (); } while (0)
|
||||
#endif
|
||||
|
||||
extern char *getpwd PROTO((void));
|
||||
|
||||
/* IMPORTANT NOTE: Please see the file README.DWARF for important details
|
||||
regarding the GNU implementation of Dwarf. */
|
||||
|
||||
|
|
|
@ -307,8 +307,6 @@ static void leaf_renumber_regs PROTO((rtx));
|
|||
#ifdef HAVE_cc0
|
||||
static int alter_cond PROTO((rtx));
|
||||
#endif
|
||||
|
||||
extern char *getpwd ();
|
||||
|
||||
/* Initialize data in final at the beginning of a compilation. */
|
||||
|
||||
|
|
90
gcc/getpwd.c
90
gcc/getpwd.c
|
@ -1,90 +0,0 @@
|
|||
/* getpwd.c - get the working directory */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
|
||||
/* Virtually every UN*X system now in common use (except for pre-4.3-tahoe
|
||||
BSD systems) now provides getcwd as called for by POSIX. Allow for
|
||||
the few exceptions to the general rule here. */
|
||||
|
||||
#if !(defined (POSIX) || defined (USG) || defined (VMS)) || defined (HAVE_GETWD)
|
||||
#define getcwd(buf,len) getwd(buf)
|
||||
#ifdef MAXPATHLEN
|
||||
#define GUESSPATHLEN (MAXPATHLEN + 1)
|
||||
#else
|
||||
#define GUESSPATHLEN 100
|
||||
#endif
|
||||
#else /* (defined (USG) || defined (VMS)) */
|
||||
/* We actually use this as a starting point, not a limit. */
|
||||
#define GUESSPATHLEN 100
|
||||
#endif /* (defined (USG) || defined (VMS)) */
|
||||
|
||||
#if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN__)))
|
||||
|
||||
/* Get the working directory. Use the PWD environment variable if it's
|
||||
set correctly, since this is faster and gives more uniform answers
|
||||
to the user. Yield the working directory if successful; otherwise,
|
||||
yield 0 and set errno. */
|
||||
|
||||
char *
|
||||
getpwd ()
|
||||
{
|
||||
static char *pwd;
|
||||
static int failure_errno;
|
||||
|
||||
char *p = pwd;
|
||||
size_t s;
|
||||
struct stat dotstat, pwdstat;
|
||||
|
||||
if (!p && !(errno = failure_errno))
|
||||
{
|
||||
if (! ((p = getenv ("PWD")) != 0
|
||||
&& *p == '/'
|
||||
&& stat (p, &pwdstat) == 0
|
||||
&& stat (".", &dotstat) == 0
|
||||
&& dotstat.st_ino == pwdstat.st_ino
|
||||
&& dotstat.st_dev == pwdstat.st_dev))
|
||||
|
||||
/* The shortcut didn't work. Try the slow, ``sure'' way. */
|
||||
for (s = GUESSPATHLEN; ! getcwd (p = xmalloc (s), s); s *= 2)
|
||||
{
|
||||
int e = errno;
|
||||
free (p);
|
||||
#ifdef ERANGE
|
||||
if (e != ERANGE)
|
||||
#endif
|
||||
{
|
||||
errno = failure_errno = e;
|
||||
p = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Cache the result. This assumes that the program does
|
||||
not invoke chdir between calls to getpwd. */
|
||||
pwd = p;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
#else /* VMS || _WIN32 && !__CYGWIN__ */
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN 255
|
||||
#endif
|
||||
|
||||
char *
|
||||
getpwd ()
|
||||
{
|
||||
static char *pwd = 0;
|
||||
|
||||
if (!pwd)
|
||||
pwd = getcwd (xmalloc (MAXPATHLEN + 1), MAXPATHLEN + 1
|
||||
#ifdef VMS
|
||||
, 0
|
||||
#endif
|
||||
);
|
||||
return pwd;
|
||||
}
|
||||
|
||||
#endif /* VMS || _WIN32 && !__CYGWIN__ */
|
|
@ -109,8 +109,6 @@ extern char *version_string;
|
|||
#define my_open(file, mode, flag) open((char *)file, mode, flag)
|
||||
#define my_chmod(file, mode) chmod((char *)file, mode)
|
||||
|
||||
extern char *getpwd ();
|
||||
|
||||
static void usage PARAMS ((void)) ATTRIBUTE_NORETURN;
|
||||
static void aux_info_corrupted PARAMS ((void)) ATTRIBUTE_NORETURN;
|
||||
static void declare_source_confusing PARAMS ((const char *)) ATTRIBUTE_NORETURN;
|
||||
|
|
Loading…
Reference in New Issue