diff options
-rw-r--r-- | def.h | 6 | ||||
-rw-r--r-- | main.c | 37 |
2 files changed, 33 insertions, 10 deletions
@@ -1,3 +1,4 @@ +/* $XdotOrg: $ */ /* $Xorg: def.h,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */ /* @@ -26,6 +27,11 @@ in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/config/makedepend/def.h,v 3.13tsi Exp $ */ +#ifdef HAVE_CONFIG_H /* Autotooled for Xorg 7.0? */ +# include "makedepend-config.h" +# define USING_AUTOCONF +#endif + #include "Xos.h" #include "Xfuncproto.h" #include <stdlib.h> @@ -1,4 +1,5 @@ /* $Xorg: main.c,v 1.5 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* $XdotOrg: $ */ /* Copyright (c) 1993, 1994, 1998 The Open Group @@ -47,10 +48,6 @@ in this Software without prior written authorization from The Open Group. #include <stdarg.h> -#ifdef MINIX -#define USE_CHMOD 1 -#endif - #ifdef DEBUG int _debugmask; #endif @@ -118,10 +115,14 @@ static void setfile_cmdinc(struct filepointer *filep, long count, char **list); static void redirect(char *line, char *makefile); static -#ifdef SIGNALRETURNSINT -int +#ifdef RETSIGTYPE +RETSIGTYPE #else +# ifdef SIGNALRETURNSINT +int +# else void +# endif #endif catch (int sig) { @@ -143,6 +144,12 @@ catch (int sig) struct sigaction sig_act; #endif /* USGISH */ +#ifndef USING_AUTOCONF +# if !defined(USGISH) && !defined(_SEQUENT_) && !defined(MINIX) +# define HAVE_FCHMOD 1 +# endif +#endif + int main(int argc, char *argv[]) { @@ -738,7 +745,17 @@ char *base_name(char *file) return(file); } -#if defined(USG) && !defined(CRAY) && !defined(SVR4) && !defined(__UNIXOS2__) && !defined(clipper) && !defined(__clipper__) +#ifdef USING_AUTOCONF +# ifndef HAVE_RENAME +# define NEED_RENAME +# endif +#else /* Imake configured, check known OS'es without rename() */ +# if defined(USG) && !defined(CRAY) && !defined(SVR4) && !defined(__UNIXOS2__) && !defined(clipper) && !defined(__clipper__) +# define NEED_RENAME +# endif +#endif + +#ifdef NEED_RENAME int rename (char *from, char *to) { (void) unlink (to); @@ -749,7 +766,7 @@ int rename (char *from, char *to) return -1; } } -#endif /* USGISH */ +#endif /* NEED_RENAME */ void redirect(char *line, char *makefile) @@ -814,11 +831,11 @@ redirect(char *line, char *makefile) } } fflush(fdout); -#if defined(USGISH) || defined(_SEQUENT_) || defined(USE_CHMOD) +#ifndef HAVE_FCHMOD chmod(makefile, st.st_mode); #else fchmod(fileno(fdout), st.st_mode); -#endif /* USGISH */ +#endif /* HAVE_FCHMOD */ } void |