Mercurial > hg > octave-lyh
changeset 10266:82db36545def
use gnulib gethostname module
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 04 Feb 2010 04:43:08 -0500 |
parents | 8c583af2cf64 |
children | 479c7df0cc96 |
files | ChangeLog bootstrap.conf configure.ac liboctave/ChangeLog liboctave/lo-cutils.c liboctave/lo-sysdep.h src/ChangeLog src/sysdep.cc |
diffstat | 8 files changed, 16 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-02-04 John W. Eaton <jwe@octave.org> + + * configure.ac: Don't check for gethostname. + * bootstrap.conf (gnulib_modules): Include gethostname in the list. + 2010-02-03 John W. Eaton <jwe@octave.org> * configure.ac: Don't check for fcntl.h or fcntl.
--- a/bootstrap.conf +++ b/bootstrap.conf @@ -23,6 +23,7 @@ fcntl fnmatch getcwd + gethostname getopt-gnu gettimeofday glob
--- a/configure.ac +++ b/configure.ac @@ -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
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2010-02-04 John W. Eaton <jwe@octave.org> + + * lo-cutils.c (gethostname): Delete function. + * lo-sysdep.h (gethostname): Delete declaration. + 2010-02-03 John W. Eaton <jwe@octave.org> * oct-syscalls.h, oct-syscalls.cc (octave_fcntl): Assume fcntl exists.
--- a/liboctave/lo-cutils.c +++ b/liboctave/lo-cutils.c @@ -55,32 +55,6 @@ qsort (base, n, size, cmp); } -#if defined (__WIN32__) && ! defined (_POSIX_VERSION) - -#include <winsock.h> - -#elif ! defined (HAVE_GETHOSTNAME) && defined (HAVE_SYS_UTSNAME_H) - -#include <sys/utsname.h> - -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) {
--- a/liboctave/lo-sysdep.h +++ b/liboctave/lo-sysdep.h @@ -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&);