[Patch] Some fixes for the MinGW port

2007-01-03 Thread Cesar Strauss

Hi,

The attached patch addresses the following issues on MinGW, when
building the CVS HEAD version of guile:

- The SCM_API tag is missing on some exported symbols;
- The LC_MESSAGES macro and the SIGBUS signal are not available on MinGW.
- The colon, when used as a delimiter in a sed command, conflicts with
paths that include a drive letter (e.g. 'c:/mingw/bin').

Cesar

* libguile:
2007-01-01  Cesar Strauss  [EMAIL PROTECTED]

* deprecated.h, version.h.in: Export some more symbols using SCM_API
(necessary on mingw).

Not all platforms define the LC_MESSAGES macro (e.g. mingw):

* i18n.c (LC_MESSAGES_MASK)[!LC_MESSAGES]: Define to 0.
* locale-categories.h (MESSAGES): Define only when LC_MESSAGES is
defined.

* guile-config:
2007-01-01  Cesar Strauss  [EMAIL PROTECTED]

* Makefile.am (guile-config): Use the pipe symbol as the sed delimiter
for the 'bindir' substitution. The colon was already used in directory
names on mingw (e.g. 'c:/mingw').

* ice-9:
2007-01-01  Cesar Strauss  [EMAIL PROTECTED]

* boot-9.scm (top-repl): In the 'signals' list, only include the SIGBUS
entry if it was defined (which is not the case on mingw).



Index: libguile/deprecated.h
===
RCS file: /sources/guile/guile/guile-core/libguile/deprecated.h,v
retrieving revision 1.39
diff -u -r1.39 deprecated.h
--- libguile/deprecated.h   17 Apr 2006 00:05:39 -  1.39
+++ libguile/deprecated.h   1 Jan 2007 18:38:42 -
@@ -164,7 +164,7 @@
 SCM (*fcn)(),
 SCM *gf);
 
-extern SCM scm_create_hook (const char* name, int n_args);
+SCM_API SCM scm_create_hook (const char* name, int n_args);
 
 #define SCM_LIST0 SCM_EOL
 #define SCM_LIST1(e0) scm_cons ((e0), SCM_EOL)
Index: libguile/version.h.in
===
RCS file: /sources/guile/guile/guile-core/libguile/version.h.in,v
retrieving revision 1.7
diff -u -r1.7 version.h.in
--- libguile/version.h.in   17 Apr 2006 00:05:42 -  1.7
+++ libguile/version.h.in   1 Jan 2007 18:38:43 -
@@ -30,12 +30,12 @@
 #define SCM_MINOR_VERSION @-GUILE_MINOR_VERSION-@
 #define SCM_MICRO_VERSION @-GUILE_MICRO_VERSION-@
 
-extern SCM scm_major_version (void);
-extern SCM scm_minor_version (void);
-extern SCM scm_micro_version (void);
-extern SCM scm_effective_version (void);
-extern SCM scm_version (void);
-extern void scm_init_version (void);
+SCM_API SCM scm_major_version (void);
+SCM_API SCM scm_minor_version (void);
+SCM_API SCM scm_micro_version (void);
+SCM_API SCM scm_effective_version (void);
+SCM_API SCM scm_version (void);
+SCM_API void scm_init_version (void);
 
 #endif  /* SCM_VERSION_H */

Index: libguile/i18n.c
===
RCS file: /sources/guile/guile/guile-core/libguile/i18n.c,v
retrieving revision 1.6
diff -u -r1.6 i18n.c
--- libguile/i18n.c 18 Nov 2006 18:14:55 -  1.6
+++ libguile/i18n.c 1 Jan 2007 18:38:43 -
@@ -105,7 +105,11 @@
 
 # define LC_CTYPE_MASK (1  LC_CTYPE)
 # define LC_COLLATE_MASK   (1  LC_COLLATE)
-# define LC_MESSAGES_MASK  (1  LC_MESSAGES)
+# ifdef LC_MESSAGES /* undefined on mingw */
+#   define LC_MESSAGES_MASK(1  LC_MESSAGES)
+# else
+#   define LC_MESSAGES_MASK0
+# endif
 # define LC_MONETARY_MASK  (1  LC_MONETARY)
 # define LC_NUMERIC_MASK   (1  LC_NUMERIC)
 # define LC_TIME_MASK  (1  LC_TIME)
Index: libguile/locale-categories.h
===
RCS file: /sources/guile/guile/guile-core/libguile/locale-categories.h,v
retrieving revision 1.1
diff -u -r1.1 locale-categories.h
--- libguile/locale-categories.h18 Nov 2006 18:18:23 -  1.1
+++ libguile/locale-categories.h1 Jan 2007 18:38:43 -
@@ -21,7 +21,9 @@
 /* The six standard categories, as defined in IEEE Std 1003.1-2001.  */
 SCM_DEFINE_LOCALE_CATEGORY (COLLATE)
 SCM_DEFINE_LOCALE_CATEGORY (CTYPE)
+#ifdef LC_MESSAGES /* undefined on mingw */
 SCM_DEFINE_LOCALE_CATEGORY (MESSAGES)
+#endif
 SCM_DEFINE_LOCALE_CATEGORY (MONETARY)
 SCM_DEFINE_LOCALE_CATEGORY (NUMERIC)
 SCM_DEFINE_LOCALE_CATEGORY (TIME)
Index: guile-config/Makefile.am
===
RCS file: /sources/guile/guile/guile-core/guile-config/Makefile.am,v
retrieving revision 1.10
diff -u -r1.10 Makefile.am
--- guile-config/Makefile.am16 Apr 2006 23:36:35 -  1.10
+++ guile-config/Makefile.am31 Dec 2006 16:21:26 -
@@ -35,7 +35,7 @@
 guile-config: guile-config.in ${top_builddir}/libguile/libpath.h
rm -f guile-config.tmp
sed  ${srcdir}/guile-config.in  guile-config.tmp \
-   -e s:@-bindir-@:${bindir}: \
+   -e 's|@-bindir-@|${bindir}|' \
-e 

Re: [Patch] Some fixes for the MinGW port

2007-01-03 Thread Kevin Ryde
Cesar Strauss [EMAIL PROTECTED] writes:

 The attached patch addresses the following issues on MinGW, when
 building the CVS HEAD version of guile:

Actually, portability things are being tackled first in the 1.8
branch, then merged into the head periodically.  There's some mingw
pthread fixes there which haven't made it to the head yet for
instance, if you'd like to give them a try.

 -# define LC_MESSAGES_MASK(1  LC_MESSAGES)
 +# ifdef LC_MESSAGES /* undefined on mingw */
 +#   define LC_MESSAGES_MASK  (1  LC_MESSAGES)
 +# else
 +#   define LC_MESSAGES_MASK  0
 +# endif

I'll leave that for Ludovic to contemplate, I think he said he'll
change it to use just the base LC bits, not an extra set of mask
values.


___
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


Re: [Patch] Some fixes for the MinGW port

2007-01-03 Thread Kevin Ryde
Cesar Strauss [EMAIL PROTECTED] writes:

 - The colon, when used as a delimiter in a sed command, conflicts with
 paths that include a drive letter (e.g. 'c:/mingw/bin').

 - -e s:@-bindir-@:${bindir}: \
 + -e 's|@-bindir-@|${bindir}|' \

Thanks.  Though I think the best advice concerning drive letters is
don't do that :-).


___
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


Re: [Patch] Some fixes for the MinGW port

2007-01-03 Thread Kevin Ryde
Cesar Strauss [EMAIL PROTECTED] writes:

 +  ;; SIGBUS is not present on mingw
 +  (if (defined? 'SIGBUS)
 +  `((,SIGBUS . Bad memory access (bus error)))
 + '()))

Thanks, I made a similar change.  I don't know why it's never shown up
before, maybe noone ever got to the repl on mingw before!


___
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


Re: [Patch] Some fixes for the MinGW port

2007-01-03 Thread Cesar Strauss

Kevin Ryde wrote:


Actually, portability things are being tackled first in the 1.8
branch, then merged into the head periodically.


I switched to the 1.8 branch. It fixes all the issues I raised, thanks!

However, the configure.ac on this branch required an upgrade of my 
versions of autoconf/automake, which (I think) caused a couple more 
issues. I will investigate this further.



There's some mingw
pthread fixes there which haven't made it to the head yet for
instance, if you'd like to give them a try.



Certainly, sounds interesting.


-# define LC_MESSAGES_MASK  (1  LC_MESSAGES)
+# ifdef LC_MESSAGES /* undefined on mingw */
+#   define LC_MESSAGES_MASK(1  LC_MESSAGES)
+# else
+#   define LC_MESSAGES_MASK0
+# endif


I'll leave that for Ludovic to contemplate, I think he said he'll
change it to use just the base LC bits, not an extra set of mask
values.




It is alright, the 1.8 branch doesn't have this issue (yet).

Thanks,
Cesar



___
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


Re: [Patch] Some fixes for the MinGW port

2007-01-03 Thread Cesar Strauss

Kevin Ryde wrote:

Cesar Strauss [EMAIL PROTECTED] writes:

+;; SIGBUS is not present on mingw
+(if (defined? 'SIGBUS)
+`((,SIGBUS . Bad memory access (bus error)))
+ '()))


Thanks, I made a similar change.  I don't know why it's never shown up
before, maybe noone ever got to the repl on mingw before!




Well, it hit me right away when I run the guile program itself, but it 
didn't seem to trigger when running scripts or when embedded in other 
programs.


Cesar



___
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


Re: [Patch] Some fixes for the MinGW port

2007-01-03 Thread Cesar Strauss

Kevin Ryde wrote:


Thanks.  Though I think the best advice concerning drive letters is
don't do that :-).




Not to mention the common use of spaces within paths, like
c:\Program Files. It is a recipe for trouble ;-) .



___
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile