[BRLTTY] MinGW

Samuel Thibault samuel.thibault at ens-lyon.org
Sun May 21 11:32:09 EDT 2006


Hi,

Lars Bjørndal, le Sun 21 May 2006 11:59:33 +0200, a écrit :
> I did a compilation yesterday with the latest CVS code. I got the same
> result - the problem with brltty.exe cannot set working directory.

Could you please try latest msys (1.0.11)? There was a restriction in
version 1.0.10: /bin could only contain msys tools, and hence brltty
couldn't work in it.

> This time, I used the configure parameter
> --with-execute-root=/c/brl. I copied the two files libiconv-2.dll
> and libintl-2.dll into the c:\brl\bin directory, and I could then
> start brltty without first starting msys. But I couldn't load the
> translation table that I use.

It seems there are only little missing bits. Could you please try the
attached patch?

Dave, there are some parts in my patch that deserve committing: SIGUSR1
doesn't necessarily exist on all systems, and mingw doesn't even have
pause(). Changes in config.c are needed for fixing preference file and
table directories. Changes in options.c and misc.c are only a dirty hack
that Lars will be happy to have, but they deserve more careful design.

Samuel
-------------- next part --------------
Index: Programs/apitest.c
===================================================================
--- Programs/apitest.c	(revision 2293)
+++ Programs/apitest.c	(working copy)
@@ -215,7 +215,9 @@
   brlapi_perror("brlapi_readKey");
 }
 
+#ifdef SIGUSR1
 void foo(int sig) { }
+#endif /* SIGUSR1 */
 
 void suspend(void)
 {
@@ -230,11 +232,17 @@
   if (brlapi_suspend(name)) {
     brlapi_perror("suspend");
   } else {
+#ifdef SIGUSR1
     signal(SIGUSR1,foo);
+#endif /* SIGUSR1 */
     fprintf(stderr, "Sleeping\n");
+#ifndef __MINGW32__
     pause();
+#endif /* __MINGW32__ */
     fprintf(stderr, "Resuming\n");
+#ifdef SIGUSR1
     signal(SIGUSR1,SIG_DFL);
+#endif /* SIGUSR1 */
     if (brlapi_resume())
       brlapi_perror("resume");
   }
Index: Programs/config.c
===================================================================
--- Programs/config.c	(revision 2293)
+++ Programs/config.c	(working copy)
@@ -1494,8 +1494,13 @@
                 const char *part2 = braille->definition.code;
                 const char *part3 = ".prefs";
                 char *path = mallocWrapper(strlen(part1) + strlen(part2) + strlen(part3) + 1);
+		char **const paths[] = {
+		  &preferencesFile,
+		  NULL
+		};
                 sprintf(path, "%s%s%s", part1, part2, part3);
                 preferencesFile = path;
+		fixInstallPaths(paths);
               }
               LogPrint(LOG_INFO, "%s: %s", gettext("Preferences File"), preferencesFile);
 
@@ -1894,6 +1899,7 @@
       &opt_configurationFile,
       &opt_dataDirectory,
       &opt_libraryDirectory,
+      &opt_tablesDirectory,
       NULL
     };
     fixInstallPaths(paths);
Index: Programs/options.c
===================================================================
--- Programs/options.c	(revision 2293)
+++ Programs/options.c	(working copy)
@@ -661,6 +661,7 @@
 void
 fixInstallPaths (char **const *paths) {
   char *programDirectory = getPathDirectory(programPath);
+  programDirectory = makePath(programDirectory, "../");
   while (*paths) {
     **paths = makePath(programDirectory, **paths);
     ++paths;
Index: Programs/misc.c
===================================================================
--- Programs/misc.c	(revision 2293)
+++ Programs/misc.c	(working copy)
@@ -347,12 +347,10 @@
   int index;
   char *path;
   components[last] = file;
-  if (file[0] != '/') {
     if (directory && *directory) {
       if (directory[strlen(directory)-1] != '/') components[--first] = "/";
       components[--first] = directory;
     }
-  }
   for (index=first; index<=last; ++index) {
     length += lengths[index] = strlen(components[index]);
   }


More information about the BRLTTY mailing list