unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* errors building guile 1.8.6 for Interix, with some small patches
@ 2009-06-19 18:52 Jay
  2010-03-26  0:59 ` Neil Jerram
  0 siblings, 1 reply; 2+ messages in thread
From: Jay @ 2009-06-19 18:52 UTC (permalink / raw)
  To: bug-guile

[-- Attachment #1: Type: text/plain, Size: 6674 bytes --]


/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.. -I/src/g
uile-1.8.6 -I.. -g -O2 -Wall -Wmissing-prototypes -Werror -MT filesys.lo -MD -
MP -MF .deps/filesys.Tpo -c -o filesys.lo /src/guile-1.8.6/libguile/filesys.c
libtool: compile: gcc -DHAVE_CONFIG_H -I.. -I/src/guile-1.8.6 -I.. -g -O2 -Wall
-Wmissing-prototypes -Werror -MT filesys.lo -MD -MP -MF .deps/filesys.Tpo -c /s
rc/guile-1.8.6/libguile/filesys.c -DPIC -o .libs/filesys.o
/src/guile-1.8.6/libguile/filesys.c: In function `scm_readdir':
/src/guile-1.8.6/libguile/filesys.c:918: warning: implicit declaration of functi
on `readdir_r'
make[3]: *** [filesys.lo] Error 1
make[3]: Leaving directory `/dev/fs/C/obj/guile/libguile'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/dev/fs/C/obj/guile/libguile'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/dev/fs/C/obj/guile'
make: *** [all] Error 2
bash-4.0$ '
 
 
c:\sfu\usr\include\dirent.h
 
 
#if defined ( _REENTRANT ) || (_POSIX_C_SOURCE - 0 >= 199506L)
extern int __cdecl readdir_r(DIR *, struct dirent *, 
struct dirent **);
#endif
 
 
config.log
configure:26632: checking for readdir_r
configure:26688: gcc -o conftest -g -O2 conftest.c -lm -lltdl >&5
configure:26695: $? = 0
configure:26717: result: yes
 
 
This is very typical of configure problems now in my experience.
configure compiles one way, checks for linking.
Compilation then does something different and fails.
I have seen this many times now in various projects.
 
 
C:\src\guile-1.8.6\libguile>\cygwin\bin\diff -u filesys.c.orig filesys.c
--- filesys.c.orig 2009-06-19 11:32:41.984375000 -0700
+++ filesys.c 2009-06-19 11:33:00.171875000 -0700
@@ -20,7 +20,7 @@
/* See stime.c for comments on why _POSIX_C_SOURCE is not always defined. */
#define _LARGEFILE64_SOURCE /* ask for stat64 etc */
-#ifdef __hpux
+#if defined(__hpux) || defined(__INTERIX)
#define _POSIX_C_SOURCE 199506L /* for readdir_r */
#endif
 
 
Hm. reading stime.c makes me think defining _REENTRANT would be better,

since it probably only gives where _POSIX can take away?
So, this also worked:
 
 
C:\src\guile-1.8.6\libguile>\cygwin\bin\diff -u filesys.c.orig filesys.c
--- filesys.c.orig      2009-06-19 11:32:41.984375000 -0700
+++ filesys.c   2009-06-19 11:48:15.546875000 -0700
@@ -23,6 +23,9 @@
 #ifdef __hpux
 #define _POSIX_C_SOURCE 199506L  /* for readdir_r */
 #endif
+#ifndef _REENTRANT
+# define _REENTRANT   /* ask Interix for readdir_r prototype */
+#endif
 #ifdef HAVE_CONFIG_H
 #  include <config.h>


 

Surely:

#if !defined(_REENTRANT) && defined(__INTERIX)

would also work if you want to narrow it down (but stime.c doesn't).
 
 
/src/guile-1.8.6/libguile/posix.c: In function `scm_seteuid':
/src/guile-1.8.6/libguile/posix.c:728: warning: implicit declaration of function
`seteuid'
/src/guile-1.8.6/libguile/posix.c: In function `scm_setegid':
/src/guile-1.8.6/libguile/posix.c:753: warning: implicit declaration of function
`setegid'
/src/guile-1.8.6/libguile/posix.c: In function `scm_putenv':
/src/guile-1.8.6/libguile/posix.c:1364: warning: implicit declaration of functio
n `unsetenv'
/src/guile-1.8.6/libguile/posix.c: In function `scm_crypt':
/src/guile-1.8.6/libguile/posix.c:1611: warning: implicit declaration of functio
n `crypt'
/src/guile-1.8.6/libguile/posix.c:1611: warning: assignment makes pointer from i
nteger without a cast
make[3]: *** [posix.lo] Error 1
make[3]: Leaving directory `/dev/fs/C/obj/guile/libguile'
 
 
I don't see these prototyped anywhere.
I don't know if this patch is acceptable, since it doesn't adapt in the future if Interix improves.
I also think there is confusion here between HAVE_SETEUID and HAVE_SETEGID.
It appears gnulib could help with unsetenv.
 
 
C:\src\guile-1.8.6\libguile>\cygwin\bin\diff -u posix.c.orig posix.c
--- posix.c.orig 2008-12-08 09:42:55.000000000 -0800
+++ posix.c 2009-06-19 11:39:28.500000000 -0700
@@ -724,7 +724,7 @@
{
int rv;
-#ifdef HAVE_SETEUID
+#if defined(HAVE_SETEUID) && !defined(__INTERIX)
rv = seteuid (scm_to_int (id));
#else
rv = setuid (scm_to_int (id));
@@ -749,7 +749,7 @@
{
int rv;
-#ifdef HAVE_SETEUID
+#if defined(HAVE_SETEUID) && !defined(__INTERIX)
rv = setegid (scm_to_int (id));
#else
rv = setgid (scm_to_int (id));
@@ -1359,7 +1359,7 @@
build would be to try "NAME" then "NAME=" at runtime, if that's not
too much like overkill. */
-#if HAVE_UNSETENV
+#if HAVE_UNSETENV && !defined(__INTERIX)
/* when unsetenv() exists then we use it */
unsetenv (c_str);
free (c_str);
@@ -1587,7 +1587,7 @@
multiple cpus. So for now we don't bother with anything fancy, just
ensure it works. */
-#if HAVE_CRYPT
+#if HAVE_CRYPT && !defined(__INTERIX)
SCM_DEFINE (scm_crypt, "crypt", 2, 0, 0,
(SCM key, SCM salt),
"Encrypt @var{key} using @var{salt} as the salt value to the\n"
C:\src\guile-1.8.6\libguile>
 
 
Later on I get to:
gawk -f ./guile-func-name-check /src/guile-1.8.6/libguile/regex-posix.c
(./guile-snarf-docs -DHAVE_CONFIG_H -I.. -I/src/guile-1.8.6 -I.. -g -O2 -Wall -
Wmissing-prototypes -Werror /src/guile-1.8.6/libguile/regex-posix.c | \
./guile_filter_doc_snarfage --filter-snarfage) > regex-posix.doc || { rm
regex-posix.doc; false; }
cat alist.doc arbiters.doc async.doc backtrace.doc boolean.doc chars.doc continu
ations.doc debug.doc deprecation.doc deprecated.doc discouraged.doc dynl.doc dyn
wind.doc environments.doc eq.doc error.doc eval.doc evalext.doc extensions.doc f
eature.doc fluids.doc fports.doc futures.doc gc.doc goops.doc gsubr.doc gc-mark.
doc gc-segment.doc gc-malloc.doc gc-card.doc guardians.doc hash.doc hashtab.doc
hooks.doc i18n.doc init.doc ioext.doc keywords.doc lang.doc list.doc load.doc ma
cros.doc mallocs.doc modules.doc numbers.doc objects.doc objprop.doc options.doc
pairs.doc ports.doc print.doc procprop.doc procs.doc properties.doc random.doc
rdelim.doc read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc smob.doc s
ort.doc srcprop.doc stackchk.doc stacks.doc stime.doc strings.doc srfi-4.doc srf
i-13.doc srfi-14.doc strorder.doc strports.doc struct.doc symbols.doc threads.do
c throw.doc values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc
ramap.doc unif.doc dynl.doc filesys.doc posix.doc net_db.doc socket.doc regex-p
osix.doc | GUILE="/dev/fs/C/obj/guile/pre-inst-guile" /src/guile-1.8.6/scripts/s
narf-check-and-output-texi > guile-procedures.texi || { rm guile-proced
ures.texi; false; }
ERROR: In procedure fport_input_waiting:
ERROR: Invalid argument
 
 
and it hangs.
I'll try to look into that later but might just configure -disable-doc and move on, leaving it hanging for anyone else. :(
 
 
- Jay


[-- Attachment #2: Type: text/html, Size: 7725 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: errors building guile 1.8.6 for Interix, with some small patches
  2009-06-19 18:52 errors building guile 1.8.6 for Interix, with some small patches Jay
@ 2010-03-26  0:59 ` Neil Jerram
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Jerram @ 2010-03-26  0:59 UTC (permalink / raw)
  To: Jay; +Cc: bug-guile

With apologies for the lateness of this response...

Jay <jay.krell@cornell.edu> writes:

> /src/guile-1.8.6/libguile/filesys.c: In function `scm_readdir':
> /src/guile-1.8.6/libguile/filesys.c:918: warning: implicit declaration of
> functi
> on `readdir_r'

[...]

> Surely:
> #if !defined(_REENTRANT) && defined(__INTERIX)
> would also work if you want to narrow it down (but stime.c doesn't).

I've committed this fix.  Given the maturity of 1.8.x, I went for the
ultraconservative option.

> /src/guile-1.8.6/libguile/posix.c: In function `scm_seteuid':
> /src/guile-1.8.6/libguile/posix.c:728: warning: implicit declaration of
> function
> `seteuid'
[...]
> I don't see these prototyped anywhere.
[...]
> C:\src\guile-1.8.6\libguile>\cygwin\bin\diff -u posix.c.orig posix.c
> --- posix.c.orig 2008-12-08 09:42:55.000000000 -0800
> +++ posix.c 2009-06-19 11:39:28.500000000 -0700
> @@ -724,7 +724,7 @@
> {
> int rv;
> -#ifdef HAVE_SETEUID
> +#if defined(HAVE_SETEUID) && !defined(__INTERIX)
> rv = seteuid (scm_to_int (id));
> #else
> rv = setuid (scm_to_int (id));

I haven't committed this and similar changes, because it seems to me
that if HAVE_SETEUID is defined, seteuid must actually be provided by
one of the Interix libraries, and someone else might want to use it via
Guile.  If there really is no header file that declares these functions,
but they are implemented by libraries, wouldn't it be nicer to add the
necessary prototype?

Regards,
      Neil




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-26  0:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-19 18:52 errors building guile 1.8.6 for Interix, with some small patches Jay
2010-03-26  0:59 ` Neil Jerram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).