Hello developers.

I tried to run OpenDX on latest cygwin.
But all 4.13, 4.20 and CVS version can't run.
So I read the source of CVS version and I made very easy patch.

1. Variable msdos_dxroot makes wrong effect.
2. Directory separator should be '/'.
3. Environment variable separator should be ':'

This patch affect only initrun() in src/misc/dx.c 

Though this patch may be far from perfect, anyway opendx
can be run under cygwin environment using this patch.

Could you include or modify this patch?

Thanks.

-- 
Tomomasa Ohkubo <[EMAIL PROTECTED]>
--- dx.c.org    Sat Dec 14 12:39:03 2002
+++ dx.c        Sat Dec 14 12:45:23 2002
@@ -80,9 +80,11 @@
 smallstr       exhilite =      "";
 namestr        FileName =      "";
 namestr        dxroot =        "";
+/*
 #if defined(cygwin)
 namestr        msdos_dxroot =  "";
 #endif
+*/
 namestr        dxexroot =      "";
 namestr        dxuiroot =      "";
 namestr        exceeddir =     "";
@@ -362,9 +364,11 @@
     getenvstr("DXARGS", dxargs);
     getcwd(curdir, sizeof(curdir));
     getenvstr("DXROOT", dxroot);
+/*
 #if defined(cygwin)
     getenvstr("MSDOS_DXROOT", msdos_dxroot);
 #endif
+*/
     getenvstr("DXDATA", dxdata);
     getenvstr("DXMACROS", dxmacros);
     getenvstr("DXMODULES", dxmodules);
@@ -390,37 +394,63 @@
 
     /* If all else fails, set some defaults for OpenSource Unix layout */
     if (!*dxroot) {
+#if defined(cygwin)
+       strcpy(dxroot, "/usr/local/dx/");
+#else
        strcpy(dxroot, "\\usr\\local\\dx\\");
+#endif
     }
+/*
 #if defined(cygwin)
     if (!*msdos_dxroot) 
        sprintf(msdos_dxroot, "\\cygwin%s", dxroot);
 #endif
+*/
 
     /* Now strip off any garbage that may have been set on dxroot */
     removeQuotes(dxroot);
     u2d(dxroot);
+/*
 #if defined(cygwin)
     u2d(msdos_dxroot);
 #endif
+*/
     if(needShortPath)
        ConvertShortPathName(dxroot);
 
+#if defined(cygwin)
+    if (dxdata && *dxdata)
+       strcat(dxdata, ":");
+    strcat(dxdata, dxroot);
+    if(dxroot[strlen(dxroot)-1] !='/')
+       strcat(dxdata, "/");
+    strcat(dxdata,"samples/data");
+#else
     if (dxdata && *dxdata)
        strcat(dxdata, ";");
     strcat(dxdata, dxroot);
     if(dxroot[strlen(dxroot)-1] !='\\')
        strcat(dxdata, "\\");
     strcat(dxdata,"samples\\data");
+#endif
 
 /* Append the default dxroot/samples/macros to current macros */
 
+#if defined(cygwin)
+    if(dxmacros && *dxmacros)
+       strcat(dxmacros, ":");
+    strcat(dxmacros, dxroot);
+    if(dxroot[strlen(dxroot)-1] !='/')
+       strcat(dxmacros, "/");
+    strcat(dxmacros,"samples/macros");
+#else
     if(dxmacros && *dxmacros)
        strcat(dxmacros, ";");
     strcat(dxmacros, dxroot);
     if(dxroot[strlen(dxroot)-1] !='\\')
        strcat(dxmacros, "\\");
     strcat(dxmacros,"samples\\macros");
+#endif
 
     /* fill envargs */
 
@@ -680,14 +710,16 @@
        else
                {
 
+/*                  
 #if defined(cygwin)
                setifnot(dxexroot, msdos_dxroot);
                setifnot(dxuiroot, msdos_dxroot);
 #else
+*/
                setifnot(dxexroot, dxroot);
                u2d(dxexroot);
                setifnot(dxuiroot, dxroot);
-#endif
+/* #endif */
                sprintf(dxexecdef, "%s\\bin_%s\\dxexec%s", dxexroot, exarch, 
EXE_EXT);
                setifnot(dxexec, dxexecdef);
                setifnot(exmode, "-r");

Reply via email to