summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2005-05-15 21:06:38 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2005-05-15 21:06:38 +0000
commitdabc4c7abcba043e206745bdb101aafb48c00c71 (patch)
tree1011b21fb41a31c7a538e688d0c180fdf36a2032 /main.c
parent4a64cca6526e26c93f7011ba5e4fedb511af4560 (diff)
downloadxorg-util-makedepend-dabc4c7abcba043e206745bdb101aafb48c00c71.tar.gz
[Modularization/autotooling project] Add support for building with autoconfXORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10
#ifdefs if present. #include "makedepend-config.h" if HAVE_CONFIG_H is defined.
Diffstat (limited to 'main.c')
-rw-r--r--main.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/main.c b/main.c
index a6c4883..ad4383c 100644
--- a/main.c
+++ b/main.c
@@ -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