On Sat, Jan 01, 2005 at 01:38:07PM +0000, Angus Leeming wrote:
> 
> The GUI stuff is icing that will take 10 minutes; I'm happy to do that.
> However, I'd prefer to leave the configure stuff to you. Happy?
> 

Sure. This patch almost works right. LyX now checks the new variable (which
was set by configure) and does the right thing.

The problem is that it introduces a dependency on the global lyxrc object
in os_win32.C, which causes lyxclient to not compile.

  g++ -g -g -fno-exceptions -mms-bitfields -Wl,--export-all-symbols
    -o lyxclient.exe boost.o client.o debug.o gettext.o messages.o
    -L/usr/local/lib ../../src/support/.libs/libsupport.a
    ../../boost/libs/regex/src/.libs/libboost_regex.a
    ../../boost/libs/filesystem/src/.libs/libboost_filesystem.a
    /usr/lib/libintl.dll.a -L/usr/lib /usr/lib/libiconv.dll.a

  ../../src/support/.libs/libsupport.a(os.o)(.text+0x568): In function
  `_ZN3lyx7support2os13external_pathERKSs':
  
/home/ksylvan/src/lyx-build/src/support/../../../lyx/src/support/os_win32.C:122:
  undefined reference to `_lyxrc'

  collect2: ld returned 1 exit status

  make: *** [lyxclient.exe] Error 1


I don't know the right way to fix this. Please take a look and see
if you can tackle this little piece in addition to the GUI stff.

Thanks!

                        ---Kayvan
-- 
Kayvan A. Sylvan          | Proud husband of       | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)
Index: lib/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/ChangeLog,v
retrieving revision 1.660
diff -u -r1.660 ChangeLog
--- lib/ChangeLog       2004/12/29 16:27:49     1.660
+++ lib/ChangeLog       2005/01/02 17:47:13
@@ -1,3 +1,7 @@
+2005-01-02  Kayvan A. Sylvan  <[EMAIL PROTECTED]>
+
+       * Added \cygwin_win32_path_fix_needed to lyrxc.defaults
+
 2004-12-29  Michael Schmitt  <[EMAIL PROTECTED]>
 
        * configure.m4: check for notepad editor
Index: lib/configure.m4
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/configure.m4,v
retrieving revision 1.88
diff -u -r1.88 configure.m4
--- lib/configure.m4    2004/12/29 16:27:49     1.88
+++ lib/configure.m4    2005/01/02 17:47:13
@@ -174,6 +174,7 @@
 fi
 
 #### Adjust PATH for Win32 (Cygwin)
+win32_path_correction=''
 case `uname -s` in
    CYGWIN*)
      tmpfname="/tmp/x$$.ltx";
@@ -188,8 +189,10 @@
        echo "configure: cygwin detected; path correction"
        srcdir=`cygpath -w "${srcdir}" | tr '\\\\' /`
        echo "srcdir=${srcdir}"
+       win32_path_correction='true'
      else
        echo "configure: cygwin detected; path correction is not needed"
+       win32_path_correction='false'
      fi
      ;;
 esac
@@ -658,6 +661,11 @@
 $rc_entries
 \\font_encoding "$chk_fontenc"
 EOF
+
+if [ "x$win32_path_correction" != "x" ]
+then
+  echo "\\cygwin_win32_path_fix_needed $win32_path_correction" >> $outfile
+fi
 
 ######## X FONTS
 # create a fonts.dir file to make X fonts available to LyX
Index: src/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/ChangeLog,v
retrieving revision 1.2070
diff -u -r1.2070 ChangeLog
--- src/ChangeLog       2004/12/29 15:38:47     1.2070
+++ src/ChangeLog       2005/01/02 17:47:15
@@ -1,3 +1,8 @@
+2005-01-02  Kayvan Sylvan  <[EMAIL PROTECTED]>
+
+       * lyxrc.h:
+       * lyxrc.C (read): Added RC_CYGWIN_PATH_FIX, cygwin_path_fix.
+
 2004-12-29  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
        * lyxlength.C (asLatexString): get rid of setprecision
Index: src/lyxrc.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/lyxrc.C,v
retrieving revision 1.179
diff -u -r1.179 lyxrc.C
--- src/lyxrc.C 2004/10/26 18:39:10     1.179
+++ src/lyxrc.C 2005/01/02 17:47:15
@@ -76,6 +76,7 @@
        { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
        { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
        { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
+       { "\\cygwin_win32_path_fix_needed", LyXRC::RC_CYGWIN_PATH_FIX },
        { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
        { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
        { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
@@ -265,6 +266,9 @@
        default_language = "english";
        show_banner = true;
 
+       // This is for the Win32 path conversion.
+       cygwin_path_fix = false;
+
        //
        date_insert_format = "%A, %e %B %Y";
        cursor_follows_scrollbar = false;
@@ -385,6 +389,12 @@
                case RC_KBMAP:
                        if (lexrc.next()) {
                                use_kbmap = lexrc.getBool();
+                       }
+                       break;
+
+               case RC_CYGWIN_PATH_FIX:
+                       if (lexrc.next()) {
+                               cygwin_path_fix = lexrc.getBool();
                        }
                        break;
 
Index: src/lyxrc.h
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/lyxrc.h,v
retrieving revision 1.89
diff -u -r1.89 lyxrc.h
--- src/lyxrc.h 2004/10/26 18:39:10     1.89
+++ src/lyxrc.h 2005/01/02 17:47:15
@@ -133,6 +133,7 @@
        RC_USER_NAME,
        RC_USER_EMAIL,
        RC_INDEX_COMMAND,
+       RC_CYGWIN_PATH_FIX,
        RC_LAST
 };
 
@@ -374,6 +375,7 @@
        std::string user_name;
        /// user email
        std::string user_email;
+        bool cygwin_path_fix;
 };
 
 
Index: src/support/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.290
diff -u -r1.290 ChangeLog
--- src/support/ChangeLog       2005/01/01 13:56:42     1.290
+++ src/support/ChangeLog       2005/01/02 17:47:16
@@ -1,3 +1,8 @@
+2005-01-02  Kayvan Sylvan  <[EMAIL PROTECTED]>
+
+       * os_win32.C (external_path): Check the new cygwin_path_fix bool
+       before translating external paths to Win32 paths.
+
 2005-01-01  Kayvan Sylvan  <[EMAIL PROTECTED]>
 
        * os_win32.C (internal_path): remove the call to MakeLatexName as
Index: src/support/os_win32.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/support/os_win32.C,v
retrieving revision 1.18
diff -u -r1.18 os_win32.C
--- src/support/os_win32.C      2005/01/01 13:56:42     1.18
+++ src/support/os_win32.C      2005/01/02 17:47:16
@@ -16,6 +16,7 @@
 #include "support/filetools.h"
 #include "support/lstrings.h"
 
+#include "lyxrc.h"
 #include "debug.h"
 
 #include <windows.h>
@@ -118,7 +119,7 @@
        string dos_path;
 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
        // Translate from cygwin path syntax to dos path syntax
-       if (is_absolute_path(p)) {
+       if (lyxrc.cygwin_path_fix && is_absolute_path(p)) {
                char dp[MAX_PATH];
                cygwin_conv_to_full_win32_path(p.c_str(), dp);
                dos_path = !dp ? "" : dp;

Reply via email to