Tue 01 Feb 2011 04:24:21 PM UTC, comment #9:
After rereading Benjamin's post at the gnulib ML I realized that the workaround is to include unistd.h twice in oct-env.cc and not in gnulib!
Sorry for the noise.
Kai (not logged in)
|
Tue 01 Feb 2011 09:13:38 AM UTC, comment #8:
Tatsuro,
I try to compile on MinGW an ran into this error too. Can you be a bit more specific in which file (line) this workaround has to be applied.
I have changed
libgnu/gethostname.c @ line 29
(I know this is autogenerated from gnulib/lib/gethostname.c)
but that does not help. I still get the error you have described in your original submission.
I am using a gnulib from yesterday an gcc 4.5.2
Kai (not logged in)
|
Sat 29 Jan 2011 09:31:06 AM UTC, comment #7:
As Benjamin posted the gnulib ML
http://old.nabble.com/Problem-with-including-%3Cunistd.h%3E-to30776696.html
Including twice unistd.h makes gnulib::gethostname was recognized correctly.
|
Sun 23 Jan 2011 06:32:38 PM UTC, comment #6:
>Why isn't that happening on your system?
I cannot find out the reason.
I will try to build octave other MinGW GCC complier.
Cygwin ships mingw-64 GCC-4.5.1 that also has 32 bit version.
And also try TDM version MinGW.
|
Sat 22 Jan 2011 06:44:30 PM UTC, comment #5:
Yes, but the difference you found is in the else part of and "if 1" block, so it would not be expanded anyway, as far as I can tell.
This part
of the code block that you posted should provide the gnulib::gethostname alias to the gnulib rpl_gethostname function It looks like it is inside two "#if 1" blocks, so it should be expanded. Why isn't that happening on your system? I don't see this anywhere in the oct-env.ii file that you posted earlier.
|
Sat 22 Jan 2011 06:14:41 PM UTC, comment #4:
I prepare build directory besides source directory. Not every time but sometimes delete all files and directories in the build directory root. I guess this is enough to cleanup. Am I right ?
***************************************************************
#if 1
/* Return the standard host name of the machine.
WARNING! The host name may or may not be fully qualified.
Put up to LEN bytes of the host name into NAME.
Null terminate it if the name is shorter than LEN.
If the host name is longer than LEN, set errno = EINVAL and return -1.
Return 0 if successful, otherwise set errno and return -1. */
# if 1
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef gethostname
# define gethostname rpl_gethostname
# endif
_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
# else
# if !0
_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
_GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
parameter is
int len. */
_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
# endif
_GL_CXXALIASWARN (gethostname);
#elif 1
# undef gethostname
# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
#elif defined GNULIB_POSIXCHECK
# undef gethostname
# if HAVE_RAW_DECL_GETHOSTNAME
_GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
"use gnulib module gethostname for portability");
# endif
#endif
***************************************
I found a difference to what you have shown
*********************
# if !0
_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
_GL_ARG_NONNULL ((1)));
# endif
***************************************
In my case 'if !0' but that you show 'if !1'
Is this a problem?
|
Sat 22 Jan 2011 04:46:41 PM UTC, comment #3:
What does configure tell you when it checks for gethostname?
Maybe you need to run "make maintainer-clean" in your libgnu directory and then reconfigure?
In your generated libgnu/unistd.h file, do you have the following lines? The #if 1 or 0 lines might be different, but you should still have parts that put gethostname in the gnulib namespace.
|
Sat 22 Jan 2011 10:27:02 AM UTC, comment #2:
>Is your copy of gnulib up to date?
Yes.
When I build octave, I always use git pull at my gnulib directory before hg pull and then execute autogen.sh. Therefore my build is carried out using up to date gnulib.
|
Sat 22 Jan 2011 06:01:57 AM UTC, comment #1:
Is your copy of gnulib up to date?
|
Thu 20 Jan 2011 04:28:30 PM UTC, original submission:
Hello
I have tried to build octave without my local patch according the suggestion.
https://savannah.gnu.org/bugs/?32158
>Please test the current sources with my patch applied
>but without any of your local patches applied.
However an error
***************
octave-work/liboctave/oct-env.cc:449:20: error: 'gethostname' is not a member of 'gnulib'
***************
occurred.
This is already reported in the maintainer list.
http://octave.1599824.n4.nabble.com/compile-error-on-oct-env-cc-in-building-octave-3-3-52-on-MinGW32-td2549610.html
But good solution has not been founded at present so I register this error to the bug tracker.
I have attached a bz2 compressed oct-env.ii file.
Anyway I recall back my local patch to go ahead further.
Regards
Tatsuro
|