[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
link errors of liboctave concering libgbu (MinGW build 3.3.50+)
From: |
John W. Eaton |
Subject: |
link errors of liboctave concering libgbu (MinGW build 3.3.50+) |
Date: |
Thu, 4 Feb 2010 04:43:49 -0500 |
On 4-Feb-2010, John W. Eaton wrote:
| On 4-Feb-2010, Tatsuro MATSUOKA wrote:
|
| | Hello
| |
| | I have tried to build the recent source
| | 2010-02-03 John W. Eaton <address@hidden>
| |
| | * configure.ac: Don't check for fcntl.h or fcntl.
| | * bootstrap.conf (gnulib_modules): Include fcntl in the list.
| |
| | Link errors of liboctave concering libgbu are occured.
| |
| | This should work unless it involves constant data structures referencing
symbols from auto-imported
| | DLLs.
| | .libs/liboctave_la-lo-cutils.o:lo-cutils.c:(.text+0x4f): undefined
reference to
| | address@hidden'
| | ../libgnu/.libs/libgnu.a(error.o):error.c:(.text+0x181): undefined
reference to `program_name'
| | ../libgnu/.libs/libgnu.a(error.o):error.c:(.text+0x1e5): undefined
reference to `program_name'
| | ../libgnu/.libs/libgnu.a(fcntl.o):fcntl.c:(.text+0x53): undefined reference
to `getdtablesize
| |
| | Any suggestions?
|
| What happens if you add gethostname to the list of modules in the
| bootstrap.conf file? You'll need to run autogen.sh and configure
| again after doing that.
Hmm, looking a little closer at this, it is probably not that simple.
Can you please try the follwoing patch?
Thanks,
jwe
# HG changeset patch
# User John W. Eaton <address@hidden>
# Date 1265276588 18000
# Node ID d5d796cdcbb01ddff1447008c0790c698357a098
# Parent 0aeae140e902301e87f060d04c66e042ad7b2b16
use gnulib gethostname module
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-04 John W. Eaton <address@hidden>
+
+ * configure.ac: Don't check for gethostname.
+ * bootstrap.conf (gnulib_modules): Include gethostname in the list.
+
2010-02-03 John W. Eaton <address@hidden>
* configure.ac: Don't check for fcntl.h or fcntl.
diff --git a/bootstrap.conf b/bootstrap.conf
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -23,6 +23,7 @@
fcntl
fnmatch
getcwd
+ gethostname
getopt-gnu
gettimeofday
glob
diff --git a/configure.ac b/configure.ac
--- 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
diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-04 John W. Eaton <address@hidden>
+
+ * lo-cutils.c (gethostname): Delete function.
+ * lo-sysdep.h (gethostname): Delete declaration.
+
2010-02-03 John W. Eaton <address@hidden>
* oct-syscalls.h, oct-syscalls.cc (octave_fcntl): Assume fcntl exists.
diff --git a/liboctave/lo-cutils.c b/liboctave/lo-cutils.c
--- 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)
{
diff --git a/liboctave/lo-sysdep.h b/liboctave/lo-sysdep.h
--- 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&);
diff --git a/src/ChangeLog b/src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-04 John W. Eaton <address@hidden>
+
+ * sysdep.cc: Don't include <sys/utsname.h>.
+
2010-02-04 John W. Eaton <address@hidden>
* graphics.h.in (gh_manager::lookup (const octave_value&)):
diff --git a/src/sysdep.cc b/src/sysdep.cc
--- a/src/sysdep.cc
+++ b/src/sysdep.cc
@@ -61,10 +61,6 @@
#include <ieeefp.h>
#endif
-#if !defined (HAVE_GETHOSTNAME) && defined (HAVE_SYS_UTSNAME_H)
-#include <sys/utsname.h>
-#endif
-
#include "cmd-edit.h"
#include "file-ops.h"
#include "lo-mappers.h"