unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* native Win32 guile 1.7.0
@ 2003-05-29 14:31 stefan
  2003-05-29 23:13 ` Kevin Ryde
  0 siblings, 1 reply; 19+ messages in thread
From: stefan @ 2003-05-29 14:31 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 355 bytes --]

Hello,

I just applied some minor modifications into CVS which allows Guile to be
cross-compiled to i386-mingw32.

Then I started my Win95 and tried to run the test-suite.  It runs and gave
the error log attached to this mail.  Can you give me some hints where to
look at for the errors/failures occurred in the test?

Thanks in advance,
	stefan@lkcc.org

[-- Attachment #2: Type: TEXT/PLAIN, Size: 14633 bytes --]

(c:/mingw/share/guile/1.7 /mingw/share/guile/site /mingw/share/guile/1.7 /mingw/share/guile .)
Running alist.test
Running bit-operations.test
Running c-api.test
Running chars.test
Running common-list.test
Running elisp.test
WARNING: (lang elisp internals signal): imported module (lang elisp internals format) overrides core binding `format'
WARNING: (lang elisp internals fset): imported module (lang elisp internals signal) overrides core binding `error'
WARNING: (lang elisp internals load): imported module (lang elisp internals signal) overrides core binding `error'
WARNING: (lang elisp internals load): imported module (lang elisp internals format) overrides core binding `format'
WARNING: (lang elisp primitives features): imported module (lang elisp internals load) overrides core binding `load'
WARNING: (lang elisp primitives format): imported module (lang elisp internals format) overrides core binding `format'
WARNING: (lang elisp internals set): imported module (lang elisp internals signal) overrides core binding `error'
WARNING: (lang elisp primitives lists): imported module (lang elisp internals signal) overrides core binding `error'
WARNING: (lang elisp primitives load): imported module (lang elisp internals load) overrides core binding `load'
WARNING: (lang elisp primitives signal): imported module (lang elisp internals signal) overrides core binding `error'
WARNING: (lang elisp primitives strings): imported module (lang elisp internals signal) overrides core binding `error'
Running environments.test
Running eval.test
UNRESOLVED: eval.test: promises: basic promise behaviour: a forced promise does not reference its environment
Running exceptions.test
Running format.test
Running gc.test
Running getopt-long.test
Running goops.test
Running guardians.test
UNRESOLVED: guardians.test: standard guardian functionality: guarding weakly referenced objects: guarded element of weak vector gets removed from weak vector
Running hooks.test
Running import.test
Running interp.test
Running list.test
Running load.test
Running numbers.test
FAIL: numbers.test: inf?: (inf? (inf))
FAIL: numbers.test: nan?: (nan? (nan))
FAIL: numbers.test: =: (not (= 0.0 0.0))
FAIL: numbers.test: =: (not (= 0 0.0))
FAIL: numbers.test: =: (not (= 0.0 0))
FAIL: numbers.test: <: (< (ash 1 256) 0.0)
FAIL: numbers.test: <: (not (< 0.0 (ash 1 256)))
FAIL: numbers.test: <: (< (1- (ash 1 1024)) 0.0)
FAIL: numbers.test: <: (< (ash 1 1024) 0.0)
FAIL: numbers.test: <: (< (1+ (ash 1 1024)) 0.0)
FAIL: numbers.test: <: (not (< 0.0 (1- (ash 1 1024))))
FAIL: numbers.test: <: (not (< 0.0 (ash 1 1024)))
FAIL: numbers.test: <: (not (< 0.0 (1+ (ash 1 1024))))
FAIL: numbers.test: <: (< 0.0 (- (1- (ash 1 1024))))
FAIL: numbers.test: <: (< 0.0 (- (ash 1 1024)))
FAIL: numbers.test: <: (< 0.0 (- (1+ (ash 1 1024))))
FAIL: numbers.test: <: (not (< (- (1- (ash 1 1024))) 0.0))
FAIL: numbers.test: <: (not (< (- (ash 1 1024)) 0.0))
FAIL: numbers.test: <: (not (< (- (1+ (ash 1 1024))) 0.0))
FAIL: numbers.test: <: (not (< 0.0 1))
FAIL: numbers.test: <: (not (< -1 0.0))
FAIL: numbers.test: <: (not (< 0.0 (ash 1 256)))
FAIL: numbers.test: <: (not (< (- (ash 1 256)) 0.0))
FAIL: numbers.test: <: (not (< 0.0 (ash 1 8192)))
FAIL: numbers.test: <: (not (< (- (ash 1 8192)) 0.0))
FAIL: numbers.test: <: (not (< 0.0 (ash 3 1023)))
FAIL: numbers.test: <: (not (< 0.0 (1+ (ash 3 1023))))
FAIL: numbers.test: <: (not (< 0.0 (1- (ash 3 1023))))
FAIL: numbers.test: max: (= 0.0 (max big*5 0.0))
FAIL: numbers.test: max: (= 0.0 (max 0.0 big*5))
FAIL: numbers.test: max: (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215 0.0)
FAIL: numbers.test: max: (0.0 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215)
FAIL: numbers.test: max: (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216 0.0)
FAIL: numbers.test: max: (0.0 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216)
FAIL: numbers.test: max: (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217 0.0)
FAIL: numbers.test: max: (0.0 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217)
FAIL: numbers.test: max: (-179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215 0.0)
FAIL: numbers.test: max: (0.0 -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215)
FAIL: numbers.test: max: (-179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216 0.0)
FAIL: numbers.test: max: (0.0 -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216)
FAIL: numbers.test: max: (-179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217 0.0)
FAIL: numbers.test: max: (0.0 -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217)
FAIL: numbers.test: min: (= big*5 (min big*5 0.0))
FAIL: numbers.test: min: (= big*5 (min 0.0 big*5))
FAIL: numbers.test: min: (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215 0.0)
FAIL: numbers.test: min: (0.0 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215)
FAIL: numbers.test: min: (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216 0.0)
FAIL: numbers.test: min: (0.0 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216)
FAIL: numbers.test: min: (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217 0.0)
FAIL: numbers.test: min: (0.0 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217)
FAIL: numbers.test: min: (-179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215 0.0)
FAIL: numbers.test: min: (0.0 -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137215)
FAIL: numbers.test: min: (-179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216 0.0)
FAIL: numbers.test: min: (0.0 -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216)
FAIL: numbers.test: min: (-179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217 0.0)
FAIL: numbers.test: min: (0.0 -179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217)
ERROR: numbers.test: /: division by zero: (/ 0.0) - arguments: ((numerical-overflow "/" "Numerical overflow" #f #f))
ERROR: numbers.test: /: division by zero: (/ 1 0.0) - arguments: ((numerical-overflow "/" "Numerical overflow" #f #f))
ERROR: numbers.test: /: division by zero: (/ bignum 0.0) - arguments: ((numerical-overflow "/" "Numerical overflow" #f #f))
ERROR: numbers.test: /: division by zero: (/ 1.0 0.0) - arguments: ((numerical-overflow "/" "Numerical overflow" #f #f))
ERROR: numbers.test: /: division by zero: (/ +i 0.0) - arguments: ((numerical-overflow "/" "Numerical overflow" #f #f))
Running optargs.test
Running options.test
Running ports.test
Running r4rs.test
FAIL: r4rs.test: (6 10 4): (load #<procedure foo (x)>)
Running reader.test
Running regexp.test
Running srfi-1.test
WARNING: (guile-user): `every' imported from both (ice-9 common-list) and (srfi srfi-1)
WARNING: (guile-user): `reduce' imported from both (ice-9 common-list) and (srfi srfi-1)
Running srfi-10.test
Running srfi-13.test
Running srfi-14.test
Running srfi-19.test
WARNING: (test-suite test-srfi-19): imported module (srfi srfi-19) overrides core binding `current-time'
ERROR: srfi-19.test: SRFI date/time library: #<procedure time-utc->date (time . tz-offset)> respects local DST if no TZ-OFFSET given - arguments: ((system-error "putenv" "~A" ("No error") (0)))
FAIL: srfi-19.test: SRFI date/time library: #<procedure time-tai->date (time . tz-offset)> respects local DST if no TZ-OFFSET given
FAIL: srfi-19.test: SRFI date/time library: #<procedure time-monotonic->date (time . tz-offset)> respects local DST if no TZ-OFFSET given
FAIL: srfi-19.test: SRFI date/time library: #<procedure julian-day->date (jdn . tz-offset)> respects local DST if no TZ-OFFSET given
FAIL: srfi-19.test: SRFI date/time library: #<procedure modified-julian-day->date (jdn . tz-offset)> respects local DST if no TZ-OFFSET given
FAIL: srfi-19.test: SRFI date/time library: string->date respects local DST if no time zone is read
Running srfi-34.test
WARNING: (test-suite test-srfi-34): imported module (srfi srfi-34) overrides core binding `raise'
Running srfi-4.test
Running srfi-9.test
Running strings.test
Running symbols.test
Running syncase.test
Running syntax.test
Running time.test
Running version.test
Running weaks.test

Totals for this test run:
passes:                 3612
failures:               62
unexpected passes:      0
expected failures:      114
unresolved test cases:  2
untested test cases:    0
unsupported test cases: 9
errors:                 6

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

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

* Re: native Win32 guile 1.7.0
  2003-05-29 14:31 native Win32 guile 1.7.0 stefan
@ 2003-05-29 23:13 ` Kevin Ryde
  2003-05-29 23:23   ` Kevin Ryde
                     ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Kevin Ryde @ 2003-05-29 23:13 UTC (permalink / raw)
  Cc: guile-devel

stefan <stefan@lkcc.org> writes:
>
>       * posix.c (s_scm_putenv): Disable use of unsetenv() for the
>       mingw32 build.
>
> #ifndef __MINGW32__

It'd be good autoconf style to test unsetenv with AC_CHECK_FUNCS if
it's not always available.  In particular that way it gets used if
added to mingw in the future.

Perhaps environ could be munged directly if unsetenv doesn't exist.
Might end up being a memory leak.  Probably not ideal to silently do
nothing.

>       * mkstemp.c: Provide prototype to avoid compiler warning.

It's usually best to just omit prototypes if they're not in a standard
header, and the return value is only an int.  It's all too easy to end
up with a conflict on some obscure system.  AC_CHECK_DECLS is the way
to go if you really want a declaration.

>       * configure.in: Removed -lm check
>
> if test $MINGW32 = no; then
>         AC_CHECK_LIB(m, main)
> fi

Doesn't it simply find -lm doesn't exist and continue?  If there has
to be a hard system dependency, autoconf deprecates $MINGW32 in favour
of "case $host in *-*-mingw*)" etc.

Libtool has an AC_CHECK_LIBM which knows about a few systems.  We use
it in gmp, not actually documented though.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-05-29 23:13 ` Kevin Ryde
@ 2003-05-29 23:23   ` Kevin Ryde
  2003-05-30  3:23   ` stefan
  2003-05-30  9:27   ` stefan
  2 siblings, 0 replies; 19+ messages in thread
From: Kevin Ryde @ 2003-05-29 23:23 UTC (permalink / raw)
  Cc: guile-devel

I wrote:
>
> It's usually best to just omit prototypes

No, forget that, I was looking at the wrong bit.  (Still true that
it's best to omit, but not when it's one's own defined function :-)


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-05-29 23:13 ` Kevin Ryde
  2003-05-29 23:23   ` Kevin Ryde
@ 2003-05-30  3:23   ` stefan
  2003-05-30 23:58     ` Kevin Ryde
  2003-05-30  9:27   ` stefan
  2 siblings, 1 reply; 19+ messages in thread
From: stefan @ 2003-05-30  3:23 UTC (permalink / raw)
  Cc: guile-devel

On Fri, 30 May 2003, Kevin Ryde wrote:

> stefan <stefan@lkcc.org> writes:
> >
> >       * posix.c (s_scm_putenv): Disable use of unsetenv() for the
> >       mingw32 build.
> >
> > #ifndef __MINGW32__
>
> It'd be good autoconf style to test unsetenv with AC_CHECK_FUNCS if
> it's not always available.  In particular that way it gets used if
> added to mingw in the future.
>
> Perhaps environ could be munged directly if unsetenv doesn't exist.
> Might end up being a memory leak.  Probably not ideal to silently do
> nothing.

I can remember that on Win32 an environment variable can be unset via
putenv somehow... I'll investigate that.

> >       * mkstemp.c: Provide prototype to avoid compiler warning.
>
> It's usually best to just omit prototypes if they're not in a standard
> header, and the return value is only an int.  It's all too easy to end
> up with a conflict on some obscure system.  AC_CHECK_DECLS is the way
> to go if you really want a declaration.

In fact there is no mkstemp() on Win32.  Basically the mkstemp.o gets
added to the list of objects when there is no in the libc.  That is why I
think the prototype can be written there (same as with inet_aton).

> >       * configure.in: Removed -lm check
> >
> > if test $MINGW32 = no; then
> >         AC_CHECK_LIB(m, main)
> > fi
>
> Doesn't it simply find -lm doesn't exist and continue?  If there has
> to be a hard system dependency, autoconf deprecates $MINGW32 in favour
> of "case $host in *-*-mingw*)" etc.
>
> Libtool has an AC_CHECK_LIBM which knows about a few systems.  We use
> it in gmp, not actually documented though.

The -lm is found but not used for anything.  When -lm is on the linker
line libtool would fail to create a dll, that is why I removed it for
mingw32.

Cheers,
	stefan@lkcc.org



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-05-29 23:13 ` Kevin Ryde
  2003-05-29 23:23   ` Kevin Ryde
  2003-05-30  3:23   ` stefan
@ 2003-05-30  9:27   ` stefan
  2003-05-31  0:20     ` Kevin Ryde
                       ` (2 more replies)
  2 siblings, 3 replies; 19+ messages in thread
From: stefan @ 2003-05-30  9:27 UTC (permalink / raw)
  Cc: guile-devel

On Fri, 30 May 2003, Kevin Ryde wrote:

> stefan <stefan@lkcc.org> writes:
> >
> >       * posix.c (s_scm_putenv): Disable use of unsetenv() for the
> >       mingw32 build.
> >
> > #ifndef __MINGW32__
>
> It'd be good autoconf style to test unsetenv with AC_CHECK_FUNCS if
> it's not always available.  In particular that way it gets used if
> added to mingw in the future.
>
> Perhaps environ could be munged directly if unsetenv doesn't exist.
> Might end up being a memory leak.  Probably not ideal to silently do
> nothing.

I just added a check for unsetenv() in the configure script and used it in
posix.c appropiately for mingw32 hosts.  Which means that a
putenv("name="); would remove the environment variable 'name'.

With the last changes in 'numbers.h' all of the errors in the error.log I
posted earlier disappear, i.e. using _copysign, _isnan and _finite solved
the problems in the 'numbers.test'.

Remaining issues about the cross-build:

 * I do use a special 'guile.cache' file as cache file for the configure
   script.  The file defines some tests to be done and chached.  I think
   this is normal for a cross-build.

 * The 'fileblocks.o' must be removed in configure before configure'ing.
   This is due to the macro AC_STRUCT_ST_BLOCKS.

 * For the 'guilereadline.dll' I need to add -lpthread to the linker line.
   That is because the scm_cell() inline function in 'inline.h' uses
   pthread_getspecific().  We could avoid that dependency by making
   scm_getspecific() a real function in 'libguile.dll' and not a simple
   macro.  Thus all the pthread dependencies are kept within
   'libguile.dll'.

Cheers,
	stefan@lkcc.org



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-05-30  3:23   ` stefan
@ 2003-05-30 23:58     ` Kevin Ryde
  2003-06-11 23:42       ` Kevin Ryde
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Ryde @ 2003-05-30 23:58 UTC (permalink / raw)
  Cc: guile-devel

stefan <stefan@lkcc.org> writes:
>
> I can remember that on Win32 an environment variable can be unset via
> putenv somehow... I'll investigate that.

Actually, I see that's a standard feature of putenv supposedly.  What
systems is it not?  Would be nice to have a reminder of them.

Perhaps it's enough to just use unsetenv if it exists, and presume
when it doesn't that putenv is fully functional.  Could start with
that until proven otherwise.  (With an addition to the test-suite to
pick up any problem.)

  /* No '=' in argument means we should remove the variable from
     the environment.  Not all putenvs understand this.  To be
     safe, we do it explicitely using unsetenv. */
#ifdef HAVE_UNSETENV
  if (strchr (SCM_STRING_CHARS (str), '=') == NULL)
    {
      unsetenv (SCM_STRING_CHARS (str));
      return;
    }
#endif


> The -lm is found but not used for anything.  When -lm is on the linker
> line libtool would fail to create a dll, that is why I removed it for
> mingw32.

Oh, not good.  Would be worth having a comment to that effect.  You
know how conditionals for strange environments build up until no-one
can remember why they were added :-).


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-05-30  9:27   ` stefan
@ 2003-05-31  0:20     ` Kevin Ryde
  2003-06-08 22:03     ` Kevin Ryde
  2003-06-11 23:54     ` native Win32 guile 1.7.0 Kevin Ryde
  2 siblings, 0 replies; 19+ messages in thread
From: Kevin Ryde @ 2003-05-31  0:20 UTC (permalink / raw)
  Cc: guile-devel

stefan <stefan@lkcc.org> writes:
>
> With the last changes in 'numbers.h' all of the errors in the error.log I
> posted earlier disappear, i.e. using _copysign, _isnan and _finite solved
> the problems in the 'numbers.test'.

I'd suggest doing those in a system-neutral style too.  _copysign is a
function I take it.  In which case add autoconf tests and use
(untested),

	/* mingw offers _copysign rather than copysign */
	#if ! HAVE_COPYSIGN && HAVE__COPYSIGN
	#define copysign _copysign
	#define HAVE_COPYSIGN 1
	#endif

Again, good for adapting automatically to the future.  (Autoconf is
about testing for features, not system types.)

>  * I do use a special 'guile.cache' file as cache file for the configure
>    script.  The file defines some tests to be done and chached.  I think
>    this is normal for a cross-build.

In principle hopefully not :-).  I needed to force
ac_cv_sys_restartable_syscalls=no when I tried a cross compile a while
ago though.

And an EXEEXT_FOR_BUILD is needed for gen-scmconfig.  I've been
meaning to propose some code I'd used for gmp in that area.

>  * The 'fileblocks.o' must be removed in configure before configure'ing.
>    This is due to the macro AC_STRUCT_ST_BLOCKS.

It's always annoying when autoconf does more than wanted.  Maybe
AC_CHECK_MEMBER should be used instead.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-05-30  9:27   ` stefan
  2003-05-31  0:20     ` Kevin Ryde
@ 2003-06-08 22:03     ` Kevin Ryde
  2003-06-11 23:15       ` Kevin Ryde
  2003-06-12  5:01       ` stefan
  2003-06-11 23:54     ` native Win32 guile 1.7.0 Kevin Ryde
  2 siblings, 2 replies; 19+ messages in thread
From: Kevin Ryde @ 2003-06-08 22:03 UTC (permalink / raw)
  Cc: guile-devel

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

stefan <stefan@lkcc.org> writes:
>
> I just added a check for unsetenv() in the configure script and used it in
> posix.c appropiately for mingw32 hosts.  Which means that a
> putenv("name="); would remove the environment variable 'name'.

I think there's a small memory leak there, viz

	(while #t (putenv "FOO"))

Perhaps

        * posix.c (s_scm_putenv): Free temporary ptr in mingw unset.

Of course the main putenv bit also leaks, but that's another story :-).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: posix.c.mingw-putenv.diff --]
[-- Type: text/x-patch, Size: 498 bytes --]

--- posix.c.~1.114.~	2003-05-31 09:42:53.000000000 +1000
+++ posix.c	2003-06-08 17:57:04.000000000 +1000
@@ -1157,7 +1157,7 @@
 	    "The return value is unspecified.")
 #define FUNC_NAME s_scm_putenv
 {
-  int rv;
+  int rv, e;
   char *ptr;
 
   SCM_VALIDATE_STRING (1, str);
@@ -1177,6 +1177,7 @@
       ptr[SCM_STRING_LENGTH (str)] = '=';
       ptr[SCM_STRING_LENGTH (str) + 1] = 0;
       rv = putenv (ptr);
+      e = errno; free (ptr); errno = e;
       if (rv < 0)
 	SCM_SYSERROR;
 #endif

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

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

* Re: native Win32 guile 1.7.0
  2003-06-08 22:03     ` Kevin Ryde
@ 2003-06-11 23:15       ` Kevin Ryde
  2003-06-12  5:01       ` stefan
  1 sibling, 0 replies; 19+ messages in thread
From: Kevin Ryde @ 2003-06-11 23:15 UTC (permalink / raw)


I wrote:
>
>         * posix.c (s_scm_putenv): Free temporary ptr in mingw unset.

In absense of violent objections, I made this change.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-05-30 23:58     ` Kevin Ryde
@ 2003-06-11 23:42       ` Kevin Ryde
  0 siblings, 0 replies; 19+ messages in thread
From: Kevin Ryde @ 2003-06-11 23:42 UTC (permalink / raw)


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

I wrote:
>
> Actually, I see that's a standard feature of putenv supposedly.  What
> systems is it not?

I see freebsd for a start.  I added a comment,


[-- Attachment #2: posix.c.unset-comment.diff --]
[-- Type: text/plain, Size: 604 bytes --]

--- posix.c.~1.116.~	2003-06-12 09:24:20.000000000 +1000
+++ posix.c	2003-06-12 09:41:29.000000000 +1000
@@ -1166,8 +1166,9 @@
     {
 #ifdef HAVE_UNSETENV
       /* No '=' in argument means we should remove the variable from
-	 the environment.  Not all putenvs understand this.  To be
-	 safe, we do it explicitely using unsetenv. */
+	 the environment.  Not all putenvs understand this (for instance
+	 FreeBSD 4.8 doesn't).  To be safe, we do it explicitely using
+	 unsetenv. */
       unsetenv (SCM_STRING_CHARS (str));
 #else
       /* On e.g. Win32 hosts putenv() called with 'name=' removes the

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

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

* Re: native Win32 guile 1.7.0
  2003-05-30  9:27   ` stefan
  2003-05-31  0:20     ` Kevin Ryde
  2003-06-08 22:03     ` Kevin Ryde
@ 2003-06-11 23:54     ` Kevin Ryde
  2003-06-14  5:36       ` stefan
  2 siblings, 1 reply; 19+ messages in thread
From: Kevin Ryde @ 2003-06-11 23:54 UTC (permalink / raw)
  Cc: guile-devel

stefan <stefan@lkcc.org> writes:
>
> I just added a check for unsetenv() in the configure script and used it in
> posix.c appropiately for mingw32 hosts.  Which means that a
> putenv("name="); would remove the environment variable 'name'.

I guess this means it's not possible to use putenv("name=") to set
name to an empty string.  I'm pretty sure it's valid to do so on other
systems.

On wine, which might not be the same as a real mingw, setting "name= "
and then changing that space to a \0 does the trick.  Bit nasty to go
changing putenvs strings like that, but unless there's a setenv or
some function hiding then there might be no choice.  Eg, (untested),



      /* If str is "FOO=", ie. attempting to set an empty string, then we
         need to see if it's been successful.  On MINGW, "FOO=" means remove
         FOO from the environment.  As a workaround, we set "FOO= ", ie. a
         space, and then modify the string returned by getenv.  It's not
         enough just to modify the string we set, because MINGW putenv
         copies it.  */
      if (ptr[SCM_STRING_LENGTH(str)-1] == '=')
        {
          SCM name = scm_substring (str, SCM_MAKINUM (0),
                                    SCM_MAKINUM (SCM_STRING_LENGTH (str) - 1));
          if (getenv (SCM_STRING_CHARS (name)) == NULL)
            {
              char  *alt = scm_malloc (SCM_STRING_LENGTH (str) + 2);
              memcpy (alt, SCM_STRING_CHARS (str), SCM_STRING_LENGTH(str));
              alt[SCM_STRING_LENGTH(str)] = ' ';
              alt[SCM_STRING_LENGTH(str)+1] = '\0';
              rv = putenv (alt);
              if (rv < 0)
                SCM_SYSERROR;
              free (ptr);   /* don't need the old string we gave to putenv */
              alt = getenv (SCM_STRING_CHARS (name));
              alt[SCM_STRING_LENGTH(str)] = '\0';
            }
        }


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-06-08 22:03     ` Kevin Ryde
  2003-06-11 23:15       ` Kevin Ryde
@ 2003-06-12  5:01       ` stefan
  2003-06-15  0:15         ` putenv tests (was: native Win32 guile 1.7.0) Kevin Ryde
  1 sibling, 1 reply; 19+ messages in thread
From: stefan @ 2003-06-12  5:01 UTC (permalink / raw)
  Cc: guile-devel

On Mon, 9 Jun 2003, Kevin Ryde wrote:

> > I just added a check for unsetenv() in the configure script and used it in
> > posix.c appropiately for mingw32 hosts.  Which means that a
> > putenv("name="); would remove the environment variable 'name'.
>
> I think there's a small memory leak there, viz
>
> 	(while #t (putenv "FOO"))
>
> Perhaps
>
>         * posix.c (s_scm_putenv): Free temporary ptr in mingw unset.
>
> Of course the main putenv bit also leaks, but that's another story :-).

I have applied the patch locally (exept the unused int e;) and will test
the proposal you mentioned in the last mail about setting the env string
to empty.

Cheers,
	stefan@lkcc.org



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-06-11 23:54     ` native Win32 guile 1.7.0 Kevin Ryde
@ 2003-06-14  5:36       ` stefan
  2003-06-14 12:24         ` Marius Vollmer
  0 siblings, 1 reply; 19+ messages in thread
From: stefan @ 2003-06-14  5:36 UTC (permalink / raw)
  Cc: guile-devel

On Thu, 12 Jun 2003, Kevin Ryde wrote:

> > I just added a check for unsetenv() in the configure script and used it in
> > posix.c appropiately for mingw32 hosts.  Which means that a
> > putenv("name="); would remove the environment variable 'name'.
>
> I guess this means it's not possible to use putenv("name=") to set
> name to an empty string.  I'm pretty sure it's valid to do so on other
> systems.
>
> On wine, which might not be the same as a real mingw, setting "name= "
> and then changing that space to a \0 does the trick.  Bit nasty to go
> changing putenvs strings like that, but unless there's a setenv or
> some function hiding then there might be no choice.  Eg, (untested),
>
>
>
>       /* If str is "FOO=", ie. attempting to set an empty string, then we
>          need to see if it's been successful.  On MINGW, "FOO=" means remove
>          FOO from the environment.  As a workaround, we set "FOO= ", ie. a
>          space, and then modify the string returned by getenv.  It's not
>          enough just to modify the string we set, because MINGW putenv
>          copies it.  */
>       if (ptr[SCM_STRING_LENGTH(str)-1] == '=')
>         {
>           SCM name = scm_substring (str, SCM_MAKINUM (0),
>                                     SCM_MAKINUM (SCM_STRING_LENGTH (str) - 1));
>           if (getenv (SCM_STRING_CHARS (name)) == NULL)
>             {
>               char  *alt = scm_malloc (SCM_STRING_LENGTH (str) + 2);
>               memcpy (alt, SCM_STRING_CHARS (str), SCM_STRING_LENGTH(str));
>               alt[SCM_STRING_LENGTH(str)] = ' ';
>               alt[SCM_STRING_LENGTH(str)+1] = '\0';
>               rv = putenv (alt);
>               if (rv < 0)
>                 SCM_SYSERROR;
>               free (ptr);   /* don't need the old string we gave to putenv */
>               alt = getenv (SCM_STRING_CHARS (name));
>               alt[SCM_STRING_LENGTH(str)] = '\0';
>             }
>         }

I tested this piece of code on  my Win95 box and modified it a bit to get
it really working.  Then I applied the code CVS.  The (putenv) primitive
now behaves equally on GNU/Linux and Win32.

Cheers,
	stefan@lkcc.org



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-06-14  5:36       ` stefan
@ 2003-06-14 12:24         ` Marius Vollmer
  2003-06-14 13:46           ` stefan
  0 siblings, 1 reply; 19+ messages in thread
From: Marius Vollmer @ 2003-06-14 12:24 UTC (permalink / raw)
  Cc: guile-devel

stefan <stefan@lkcc.org> writes:

> I tested this piece of code on  my Win95 box and modified it a bit to get
> it really working.  Then I applied the code CVS.  The (putenv) primitive
> now behaves equally on GNU/Linux and Win32.

Hmm, while you are at it, could you try to clean up the code in
general?  That is, make it so that we always have unsetenv and can use
it in scm_putenv.  unsetenv could be put into libguile/unsetenv.c, ala
libguile/putenv.c.  Makes sense?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-06-14 12:24         ` Marius Vollmer
@ 2003-06-14 13:46           ` stefan
  2003-06-14 16:18             ` Marius Vollmer
  0 siblings, 1 reply; 19+ messages in thread
From: stefan @ 2003-06-14 13:46 UTC (permalink / raw)
  Cc: guile-devel

On 14 Jun 2003, Marius Vollmer wrote:

> > I tested this piece of code on  my Win95 box and modified it a bit to get
> > it really working.  Then I applied the code CVS.  The (putenv) primitive
> > now behaves equally on GNU/Linux and Win32.
>
> Hmm, while you are at it, could you try to clean up the code in
> general?  That is, make it so that we always have unsetenv and can use
> it in scm_putenv.  unsetenv could be put into libguile/unsetenv.c, ala
> libguile/putenv.c.  Makes sense?

Unfortunately I don't know where to get the file unsetenv.c from.  Could
you please send me an appropriate URL?  Then I am going to test it on the
Win95 box and will apply the changes to CVS, if it works.

Cheers,
	stefan@lkcc.org



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-06-14 13:46           ` stefan
@ 2003-06-14 16:18             ` Marius Vollmer
  2003-06-16 17:25               ` stefan
  0 siblings, 1 reply; 19+ messages in thread
From: Marius Vollmer @ 2003-06-14 16:18 UTC (permalink / raw)
  Cc: guile-devel

stefan <stefan@lkcc.org> writes:

> On 14 Jun 2003, Marius Vollmer wrote:
> 
> > > I tested this piece of code on  my Win95 box and modified it a bit to get
> > > it really working.  Then I applied the code CVS.  The (putenv) primitive
> > > now behaves equally on GNU/Linux and Win32.
> >
> > Hmm, while you are at it, could you try to clean up the code in
> > general?  That is, make it so that we always have unsetenv and can use
> > it in scm_putenv.  unsetenv could be put into libguile/unsetenv.c, ala
> > libguile/putenv.c.  Makes sense?
> 
> Unfortunately I don't know where to get the file unsetenv.c from.  Could
> you please send me an appropriate URL?

That file does not exist yet, you would have to create it.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* putenv tests (was: native Win32 guile 1.7.0)
  2003-06-12  5:01       ` stefan
@ 2003-06-15  0:15         ` Kevin Ryde
  0 siblings, 0 replies; 19+ messages in thread
From: Kevin Ryde @ 2003-06-15  0:15 UTC (permalink / raw)


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

I think I'll add some small test cases for putenv and friends,

	* tests/posix.test: New file.
	* Makefile.am (SCM_TESTS): Add it.

I don't want to gratuitously provoke failures, but the tests reflect
the documentation and systems with problems need to be identified :-).


[-- Attachment #2: posix.test --]
[-- Type: text/plain, Size: 2184 bytes --]

;;;; posix.test --- Test suite for Guile POSIX functions. -*- scheme -*-
;;;;
;;;; Copyright 2003 Free Software Foundation, Inc.
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2, or (at your option)
;;;; any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this software; see the file COPYING.  If not, write to
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
;;;; Boston, MA 02111-1307 USA

(use-modules (test-suite lib))


;;
;; putenv
;;

(with-test-prefix "putenv"
  
  (pass-if "something"
    (putenv "FOO=something")
    (equal? "something" (getenv "FOO")))
  
  (pass-if "replacing"
    (putenv "FOO=one")
    (putenv "FOO=two")
    (equal? "two" (getenv "FOO")))
  
  (pass-if "empty"
    (putenv "FOO=")
    (equal? "" (getenv "FOO")))
  
  (pass-if "removing"
    (putenv "FOO=bar")
    (putenv "FOO")
    (not (getenv "FOO")))
  
  (pass-if "modifying string doesn't change env"
    (let ((s (string-copy "FOO=bar")))
      (putenv s)
      (string-set! s 5 #\x)
      (equal? "bar" (getenv "FOO")))))

;;
;; setenv
;;

(with-test-prefix "setenv"
  
  (pass-if "something"
    (setenv "FOO" "something")
    (equal? "something" (getenv "FOO")))
  
  (pass-if "replacing"
    (setenv "FOO" "one")
    (setenv "FOO" "two")
    (equal? "two" (getenv "FOO")))

  (pass-if "empty"
    (setenv "FOO" "")
    (equal? "" (getenv "FOO")))
  
  (pass-if "removing"
    (setenv "FOO" "something")
    (setenv "FOO" #f)
    (not (getenv "FOO"))))
  
;;
;; unsetenv
;;

(with-test-prefix "unsetenv"
  
  (pass-if "something"
    (putenv "FOO=something")
    (unsetenv "FOO")
    (not (getenv "FOO")))
  
  (pass-if "empty"
    (putenv "FOO=")
    (unsetenv "FOO")
    (not (getenv "FOO"))))

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

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

* Re: native Win32 guile 1.7.0
  2003-06-14 16:18             ` Marius Vollmer
@ 2003-06-16 17:25               ` stefan
  2003-06-18 23:42                 ` Marius Vollmer
  0 siblings, 1 reply; 19+ messages in thread
From: stefan @ 2003-06-16 17:25 UTC (permalink / raw)
  Cc: guile-devel

On 14 Jun 2003, Marius Vollmer wrote:

> > > > I tested this piece of code on  my Win95 box and modified it a bit to get
> > > > it really working.  Then I applied the code CVS.  The (putenv) primitive
> > > > now behaves equally on GNU/Linux and Win32.
> > >
> > > Hmm, while you are at it, could you try to clean up the code in
> > > general?  That is, make it so that we always have unsetenv and can use
> > > it in scm_putenv.  unsetenv could be put into libguile/unsetenv.c, ala
> > > libguile/putenv.c.  Makes sense?
> >
> > Unfortunately I don't know where to get the file unsetenv.c from.  Could
> > you please send me an appropriate URL?
>
> That file does not exist yet, you would have to create it.

Do you actually mean an implementation for *all* systems which don't
support unsetenv() or an implementation for WIn32 only (i.e.
win32-unsetenv.c)?

Cheers,
	stefan@lkcc.org



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

* Re: native Win32 guile 1.7.0
  2003-06-16 17:25               ` stefan
@ 2003-06-18 23:42                 ` Marius Vollmer
  0 siblings, 0 replies; 19+ messages in thread
From: Marius Vollmer @ 2003-06-18 23:42 UTC (permalink / raw)
  Cc: guile-devel

stefan <stefan@lkcc.org> writes:

> > That file does not exist yet, you would have to create it.
> 
> Do you actually mean an implementation for *all* systems which don't
> support unsetenv() or an implementation for WIn32 only (i.e.
> win32-unsetenv.c)?

Hmm, that would be something for you to decide. :-) The main objective
is to make the code cleaner, while keeping the current behavior.
I.e., it should work on all systems it does work on now, but the
portability cruft should be moved out of the main code somewhere into
a corner.  I don't know whether that is really feasible, I just
wondered if you would like to try it out...

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


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

end of thread, other threads:[~2003-06-18 23:42 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-29 14:31 native Win32 guile 1.7.0 stefan
2003-05-29 23:13 ` Kevin Ryde
2003-05-29 23:23   ` Kevin Ryde
2003-05-30  3:23   ` stefan
2003-05-30 23:58     ` Kevin Ryde
2003-06-11 23:42       ` Kevin Ryde
2003-05-30  9:27   ` stefan
2003-05-31  0:20     ` Kevin Ryde
2003-06-08 22:03     ` Kevin Ryde
2003-06-11 23:15       ` Kevin Ryde
2003-06-12  5:01       ` stefan
2003-06-15  0:15         ` putenv tests (was: native Win32 guile 1.7.0) Kevin Ryde
2003-06-11 23:54     ` native Win32 guile 1.7.0 Kevin Ryde
2003-06-14  5:36       ` stefan
2003-06-14 12:24         ` Marius Vollmer
2003-06-14 13:46           ` stefan
2003-06-14 16:18             ` Marius Vollmer
2003-06-16 17:25               ` stefan
2003-06-18 23:42                 ` Marius Vollmer

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).