This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
f77 patch for hostname
- To: egcs-patches at cygnus dot com
- Subject: f77 patch for hostname
- From: Robert Lipe <robertl at dgii dot com>
- Date: Sun, 5 Jul 1998 23:52:30 -0500
- Cc: burley at gnu dot ai dot mit dot edu, d dot love at dl dot ac dot uk
Even though a toplevl 'make check' runs a g77 library testsuite,
failures in it don't show up becuase they're not dejagnu tests. So
these tend to get lost in the noise (and delay) of the testsuite.
Still, I caught this one by eye and believe I nailed it.
Some systems (SCO Unix, SCO OpenServer, and I'm pretty sure that "most"
SVR4's, though I could be wrong) require you to link against -lsocket if
you expect to find gethostname or related functions. I've always found
this annoying, but that's the way it is.
This fixes is in the library and the testsuite.
Whoever checks this in will need to regenerate the configure script
since my autoconf seems to make too many gratituous changes. Not
actively following the g77 stuff, I'd be more comfortable if someone
else turned the commit crank on this.
* libU77/configure.in: Look for -lsocket, add to LIBS if found.
libU77/Makefile: Use LIBS from above.
Index: Makefile.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libf2c/libU77/Makefile.in,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile.in
--- Makefile.in 1998/06/15 07:52:05 1.3
+++ Makefile.in 1998/07/06 04:44:20
@@ -26,6 +26,7 @@
srcdir = @srcdir@
VPATH = @srcdir@
+lib = @LIBS@
# gcc/f/runtime/configure sets this to all the -D options appropriate
# for the configuration.
Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libf2c/libU77/configure.in,v
retrieving revision 1.1
diff -u -p -r1.1 configure.in
--- configure.in 1998/02/01 01:37:08 1.1
+++ configure.in 1998/07/06 04:44:20
@@ -95,6 +95,9 @@ AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
AC_STRUCT_TM
+dnl Some systems (SVR4, SCO OpenServer) need -lsocket for gethostname()
+AC_CHECK_LIB(socket, gethostname, [LIBS="$LIBS -lsocket"])
+
dnl Checks for library functions.
AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock \