# HG changeset patch # User John W. Eaton # Date 1265276588 18000 # Node ID 82db36545def309989b921223a2586beec177f2a # Parent 8c583af2cf645d53cbe326c617866e32960f894d use gnulib gethostname module diff -r 8c583af2cf64 -r 82db36545def ChangeLog --- a/ChangeLog Thu Feb 04 03:56:28 2010 -0500 +++ b/ChangeLog Thu Feb 04 04:43:08 2010 -0500 @@ -1,3 +1,8 @@ +2010-02-04 John W. Eaton + + * configure.ac: Don't check for gethostname. + * bootstrap.conf (gnulib_modules): Include gethostname in the list. + 2010-02-03 John W. Eaton * configure.ac: Don't check for fcntl.h or fcntl. diff -r 8c583af2cf64 -r 82db36545def bootstrap.conf --- a/bootstrap.conf Thu Feb 04 03:56:28 2010 -0500 +++ b/bootstrap.conf Thu Feb 04 04:43:08 2010 -0500 @@ -23,6 +23,7 @@ fcntl fnmatch getcwd + gethostname getopt-gnu gettimeofday glob diff -r 8c583af2cf64 -r 82db36545def configure.ac --- a/configure.ac Thu Feb 04 03:56:28 2010 -0500 +++ b/configure.ac Thu Feb 04 04:43:08 2010 -0500 @@ -1370,18 +1370,13 @@ AC_SUBST(SCRIPTS_EXE_SUFFIX) ### special checks for odd OS specific things. -### -### I am told that on some SCO systems, the only place to find some -### functions like gethostname and gettimeofday is in libsocket. -AC_CHECK_FUNCS(gethostname, [], [AC_CHECK_LIB(socket, gethostname)]) AC_CHECK_FUNCS(getpwnam, [], [AC_CHECK_LIB(sun, getpwnam)]) NO_UNDEFINED_LDFLAG= case "$canonical_host_type" in *-*-cygwin*) - AC_CHECK_LIB(wsock32, gethostname) - LIBS="$LIBS -lwsock32" + LIBS="$LIBS -lwsock32" ;; *-*-mingw*) if test "$have_msvc" = "yes"; then diff -r 8c583af2cf64 -r 82db36545def liboctave/ChangeLog --- a/liboctave/ChangeLog Thu Feb 04 03:56:28 2010 -0500 +++ b/liboctave/ChangeLog Thu Feb 04 04:43:08 2010 -0500 @@ -1,3 +1,8 @@ +2010-02-04 John W. Eaton + + * lo-cutils.c (gethostname): Delete function. + * lo-sysdep.h (gethostname): Delete declaration. + 2010-02-03 John W. Eaton * oct-syscalls.h, oct-syscalls.cc (octave_fcntl): Assume fcntl exists. diff -r 8c583af2cf64 -r 82db36545def liboctave/lo-cutils.c --- a/liboctave/lo-cutils.c Thu Feb 04 03:56:28 2010 -0500 +++ b/liboctave/lo-cutils.c Thu Feb 04 04:43:08 2010 -0500 @@ -55,32 +55,6 @@ qsort (base, n, size, cmp); } -#if defined (__WIN32__) && ! defined (_POSIX_VERSION) - -#include - -#elif ! defined (HAVE_GETHOSTNAME) && defined (HAVE_SYS_UTSNAME_H) - -#include - -int -gethostname (char *name, int namelen) -{ - int i; - struct utsname ut; - - --namelen; - - uname (&ut); - i = strlen (ut.nodename) + 1; - strncpy (name, ut.nodename, i < namelen ? i : namelen); - name[namelen] = '\0'; - - return 0; -} - -#endif - OCTAVE_API int octave_strcasecmp (const char *s1, const char *s2) { diff -r 8c583af2cf64 -r 82db36545def liboctave/lo-sysdep.h --- a/liboctave/lo-sysdep.h Thu Feb 04 03:56:28 2010 -0500 +++ b/liboctave/lo-sysdep.h Thu Feb 04 04:43:08 2010 -0500 @@ -32,10 +32,6 @@ extern int octave_chdir (const std::string&); -#if ! defined (HAVE_GETHOSTNAME) && defined (HAVE_SYS_UTSNAME_H) -extern int gethostname (char *, int); -#endif - #if defined (__WIN32__) && ! defined (__CYGWIN__) extern pid_t octave_popen2 (const std::string&, const string_vector&, bool, int *, std::string&); diff -r 8c583af2cf64 -r 82db36545def src/ChangeLog --- a/src/ChangeLog Thu Feb 04 03:56:28 2010 -0500 +++ b/src/ChangeLog Thu Feb 04 04:43:08 2010 -0500 @@ -1,3 +1,7 @@ +2010-02-04 John W. Eaton + + * sysdep.cc: Don't include . + 2010-02-04 John W. Eaton * graphics.h.in (gh_manager::lookup (const octave_value&)): diff -r 8c583af2cf64 -r 82db36545def src/sysdep.cc --- a/src/sysdep.cc Thu Feb 04 03:56:28 2010 -0500 +++ b/src/sysdep.cc Thu Feb 04 04:43:08 2010 -0500 @@ -61,10 +61,6 @@ #include #endif -#if !defined (HAVE_GETHOSTNAME) && defined (HAVE_SYS_UTSNAME_H) -#include -#endif - #include "cmd-edit.h" #include "file-ops.h" #include "lo-mappers.h"