Check.
* libU77/config.h.in (HAVE_GETLOGIN, HAVE_GETGID, HAVE_GETUID,
HAVE_KILL, HAVE_LINK, HAVE_TTYNAME): New defs.
* libU77/getlog_.c: Conditionalize for target platform. Set errno
to ENOSYS if target libc doesn't have the function.
* libU77/getgid_.c: Likewise.
* libU77/getuid_.c: Likewise.
* libU77/kill_.c: Likewise.
* libU77/link_.c: Likewise.
* libU77/ttynam_.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17562
138bc75d-0d04-0410-961f-
82ee72b054a4
#### Start of system configuration section. ####
-# The _FOR_TARGET things are appropriate for a cross-make, passed by the
-# superior makefile
-GCC_FOR_TARGET = @CC@
-CC = $(GCC_FOR_TARGET)
-CFLAGS = @CFLAGS@ $(GCC_FLAGS)
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
-CGFLAGS = #-g0
# f2c.h should already be installed in xgcc's include directory but add that
# to -I anyhow in case not using xgcc. fio.h is in libI77. We need config.h
# from `.'.
-ALL_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/../libI77 -I../../../include $(CPPFLAGS) $(DEFS) $(CFLAGS)
-AR = @AR@
-AR_FLAGS = rc
-RANLIB = @RANLIB@
-RANLIB_TEST = @RANLIB_TEST@
+ALL_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/../libI77 -I.. $(CPPFLAGS) $(DEFS) $(CFLAGS)
CROSS = @CROSS@
-G77DIR = ../../../
.SUFFIXES:
.SUFFIXES: .c .o
.c.o:
- $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $(CGFLAGS) $<
+ $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $<
OBJS = VersionU.o gerror_.o perror_.o ierrno_.o itime_.o time_.o \
unlink_.o fnum_.o getpid_.o getuid_.o getgid_.o kill_.o rand_.o \
umask_.c sys_clock_.c date_.c second_.c flush1_.c mclock_.c \
alarm_.c
-F2C_H = ../../../include/f2c.h
+F2C_H = ../f2c.h
all: $(OBJS)
$(OBJS): $(F2C_H) config.h
check:
- -$(G77DIR)g77 --driver=$(G77DIR)/xgcc -B$(G77DIR) -g $(srcdir)/u77-test.f $(lib) && ./a.out
+ -$(G77DIR)g77 -B$(G77DIR) -g $(srcdir)/u77-test.f $(lib) && ./a.out
rm -f a.out
access_.o: access_.c
/* Define if you have the times function. */
#undef HAVE_TIMES
+/* Define if you have the getlogin function. */
+#undef HAVE_GETLOGIN
+
+/* Define if you have the getgid function. */
+#undef HAVE_GETGID
+
+/* Define if you have the getuid function. */
+#undef HAVE_GETUID
+
+/* Define if you have the kill function. */
+#undef HAVE_KILL
+
+/* Define if you have the link function. */
+#undef HAVE_LINK
+
+/* Define if you have the ttyname function. */
+#undef HAVE_TTYNAME
dnl Checks for library functions.
AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock \
- getrusage times alarm)
+ getrusage times alarm getlogin getgid getuid kill link ttyname)
test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o"
test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o"
test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o"
#include <unistd.h>
#endif
#include <sys/types.h>
+#include <errno.h> /* for ENOSYS */
#include "f2c.h"
#ifdef KR_headers
integer G77_getgid_0 (void)
#endif
{
+#if defined (HAVE_GETGID)
return getgid ();
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
}
#else
# include <strings.h>
#endif
+#include <errno.h> /* for ENOSYS */
#include "f2c.h"
/* getlogin not in svr1-3 */
{
size_t i;
char *p;
+ int status;
+#if defined (HAVE_GETLOGIN)
p = getlogin ();
if (p != NULL) {
i = strlen (p);
} else {
s_copy (str, " ", Lstr, 1);
}
- return 0;
+ status = 0;
+#else
+ errno = ENOSYS;
+ status = -1;
+#endif
+ return status;
}
#include <unistd.h>
#endif
#include <sys/types.h>
+#include <errno.h> /* for ENOSYS */
#include "f2c.h"
#ifdef KR_headers
integer G77_getuid_0 (void)
#endif
{
+#if defined (HAVE_GETUID)
return getuid ();
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
}
integer G77_kill_0 (const integer *pid, const integer *signum)
#endif
{
+#if defined (HAVE_KILL)
return kill ((pid_t) *pid, *signum) ? errno : 0;
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
}
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
+#include <errno.h> /* for ENOSYS */
#include "f2c.h"
#ifdef KR_headers
integer G77_link_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2)
#endif
{
+#if defined (HAVE_LINK)
char *buff1, *buff2;
char *bp, *blast;
int i;
i = link (buff1, buff2);
free (buff1); free (buff2);
return i ? errno : 0;
+#else /* ! HAVE_LINK */
+ errno = ENOSYS;
+ return -1;
+#endif
}
#else
# include <strings.h>
#endif
+#include <errno.h> /* for ENOSYS */
#include "f2c.h"
#ifdef KR_headers
/* Character */ void G77_ttynam_0 (char *ret_val, ftnlen ret_val_len, integer *lunit)
#endif
{
+#if defined (HAVE_TTYNAME)
size_t i;
char *p;
} else {
s_copy (ret_val, " ", ret_val_len, 1);
}
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
}