]> git.lyx.org Git - lyx.git/blob - development/OS2/quick_fix.patch
OS/2 updates
[lyx.git] / development / OS2 / quick_fix.patch
1 Index: lyx-devel/config/progtest.m4
2 ===================================================================
3 RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/progtest.m4,v
4 retrieving revision 1.2
5 diff -u -r1.2 progtest.m4
6 --- lyx-devel/config/progtest.m4        2000/01/08 21:02:55     1.2
7 +++ lyx-devel/config/progtest.m4        2000/11/12 08:09:08
8 @@ -11,6 +11,19 @@
9  dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
10  dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
11  AC_DEFUN(AM_PATH_PROG_WITH_TEST,
12 +[case "`uname -s 2> /dev/null`" in
13 +OS/2)
14 +  PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
15 +  PATH_IFS=';'
16 +  EXE_EXT='.exe'
17 +  CMD_EXT='.cmd'
18 +  ;;
19 +*)
20 +  PATH_IFS=':'
21 +  EXE_EXT=''
22 +  CMD_EXT=''
23 +  ;;
24 +esac]
25  [# Extract the first word of "$2", so it can be a program name with args.
26  set dummy $2; ac_word=[$]2
27  AC_MSG_CHECKING([for $ac_word])
28 @@ -20,10 +33,12 @@
29    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
30    ;;
31    *)
32 -  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
33 +  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}$PATH_IFS"
34    for ac_dir in ifelse([$5], , $PATH, [$5]); do
35      test -z "$ac_dir" && ac_dir=.
36 -    if test -f $ac_dir/$ac_word; then
37 +    if test -f $ac_dir/$ac_word \
38 +        -o -f $ac_dir/$ac_word$EXE_EXT \
39 +        -o -f $ac_dir/$ac_word$CMD_EXT; then
40        if [$3]; then
41         ac_cv_path_$1="$ac_dir/$ac_word"
42         break
43 Index: lyx-devel/lib/configure.m4
44 ===================================================================
45 RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v
46 retrieving revision 1.15
47 diff -u -r1.15 configure.m4
48 --- lyx-devel/lib/configure.m4  2000/11/07 12:07:13     1.15
49 +++ lyx-devel/lib/configure.m4  2000/11/12 08:09:13
50 @@ -28,6 +28,19 @@
51  dnl
52  define(SEARCH_PROG,[dnl
53  changequote([,])dnl
54 +case "`uname -s 2> /dev/null`" in
55 +OS/2)
56 +  PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
57 +  PATH_IFS=';'
58 +  EXE_EXT='.exe'
59 +  CMD_EXT='.cmd'
60 +  ;;
61 +*)
62 +  PATH_IFS=':'
63 +  EXE_EXT=''
64 +  CMD_EXT=''
65 +  ;;
66 +esac
67  MSG_CHECKING($1)
68  MSG_RESULT(($3))
69  $2=
70 @@ -37,10 +50,12 @@
71  set dummy $ac_prog ; ac_word=$[2]
72  if test -n "$ac_word"; then
73    MSG_CHECKING([for \"$ac_word\"],[+])
74 -  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
75 +  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="$PATH_IFS"
76    for ac_dir in $PATH; do
77      test -z "$ac_dir" && ac_dir=.
78 -    if test -x [$ac_dir/$ac_word]; then
79 +    if test -x [$ac_dir/$ac_word] \
80 +       -o -x [$ac_dir/$ac_word$EXE_EXT] \
81 +       -o -x [$ac_dir/$ac_word$CMD_EXT]; then
82        $2="$ac_prog"
83        break
84      fi
85 @@ -180,8 +195,17 @@
86  fi
87  
88  # Search for an installed reLyX or a ready-to-install one
89 +case "`uname -s 2> /dev/null`" in
90 +OS/2)
91 +save_PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
92 +PATH_IFS=';'
93 +;;
94 +*)
95  save_PATH=${PATH}
96 -PATH=${PATH}:./reLyX/
97 +PATH_IFS=':'
98 +;;
99 +esac
100 +PATH=${PATH}${PATH_IFS}./reLyX/
101  SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command,reLyX)
102  PATH=${save_PATH}
103  test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$FName"
104 Index: lyx-devel/lib/reLyX/acinclude.m4
105 ===================================================================
106 RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/reLyX/acinclude.m4,v
107 retrieving revision 1.2
108 diff -u -r1.2 acinclude.m4
109 --- lyx-devel/lib/reLyX/acinclude.m4    2000/11/07 12:07:13     1.2
110 +++ lyx-devel/lib/reLyX/acinclude.m4    2000/11/12 08:09:15
111 @@ -10,15 +10,24 @@
112  dnl RELYX_SEARCH_PROG(VARIABLE-NAME,PROGRAMS-LIST,ACTION-IF-FOUND)
113  dnl             
114  define(RELYX_SEARCH_PROG,[dnl
115 +case "`uname -s 2> /dev/null`" in
116 +OS/2)
117 +  PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
118 +  PATH_IFS=';'
119 +  ;;
120 +*)
121 +  PATH_IFS=':'
122 +  ;;
123 +esac
124  for ac_prog in $2 ; do
125  # Extract the first word of "$ac_prog", so it can be a program name with
126  # args.
127    set dummy $ac_prog ; ac_word=$[2]
128    if test ! -n "[$]$1"; then
129 -    IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
130 +    IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}$PATH_IFS"
131      for ac_dir in $PATH; do
132        test -z "$ac_dir" && ac_dir=.
133 -      if test -f [$ac_dir/$ac_word]; then
134 +      if test -f [$ac_dir/$ac_word] -o -f [$ac_dir/$ac_word$ac_exeext]; then
135          $1="$ac_prog"
136          break
137        fi
138 Index: lyx-devel/lib/reLyX/configure.in
139 ===================================================================
140 RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/reLyX/configure.in,v
141 retrieving revision 1.8
142 diff -u -r1.8 configure.in
143 --- lyx-devel/lib/reLyX/configure.in    2000/06/26 15:33:12     1.8
144 +++ lyx-devel/lib/reLyX/configure.in    2000/11/12 08:09:15
145 @@ -2,6 +2,7 @@
146  AC_INIT(reLyX.in)
147  AC_PREREQ(2.13) dnl We want to use autoconf 2.13
148  AC_CONFIG_AUX_DIR(../../config)
149 +AC_EXEEXT
150  
151  dnl PACKAGE=reLyX
152  dnl Do this to install in $datadir/lyx/reLyX instead of $datadir/reLyX/reLyX
153 Index: lyx-devel/src/lyx_cb.C
154 ===================================================================
155 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v
156 retrieving revision 1.128
157 diff -u -r1.128 lyx_cb.C
158 --- lyx-devel/src/lyx_cb.C      2000/11/10 17:29:45     1.128
159 +++ lyx-devel/src/lyx_cb.C      2000/11/12 08:09:18
160 @@ -321,6 +321,7 @@
161  #if 0
162  void MenuFax(Buffer * buffer)
163  {
164 +#ifndef __EMX__
165         // Generate postscript file
166         if (!Exporter::Export(buffer, "ps", true))
167                 return;
168 @@ -328,6 +329,15 @@
169         // Send fax
170         string const ps = OnlyFilename(ChangeExtension(buffer->fileName(), 
171                                                        ".ps"));
172 +#else
173 +       // Generate tiff file
174 +       if (!Exporter::Export(buffer, "tiff", true))
175 +               return;
176 +
177 +       // Send fax
178 +       string const ps = OnlyFilename(ChangeExtension(buffer->fileName(), 
179 +                                                      ".tif"));
180 +#endif
181  
182         string path = OnlyPath (buffer->fileName());
183         if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) {
184 Index: lyx-devel/src/os2_defines.h
185 ===================================================================
186 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/os2_defines.h,v
187 retrieving revision 1.5
188 diff -u -r1.5 os2_defines.h
189 --- lyx-devel/src/os2_defines.h 2000/11/08 09:39:44     1.5
190 +++ lyx-devel/src/os2_defines.h 2000/11/12 08:09:18
191 @@ -13,16 +13,22 @@
192  #ifndef OS2_DEFINES_H
193  #define OS2_DEFINES_H
194  
195 +#if defined (__cplusplus)
196  #include <cctype>
197 -#include <process.h>
198  #include <cstdlib>
199 +extern "C" inline int readlink(const char *, char *, size_t) {return -1;}
200 +#else
201 +#include <ctype.h>
202 +#include <stdlib.h>
203 +#define readlink(s, t, l) (-1)
204 +#endif
205 +#include <process.h>
206  #include <unistd.h>
207  #include <X11/Xlocale.h>
208  /* #include <malloc.h> */
209  #define lstat stat
210  #define S_ISLNK(x) false
211  #define S_ISBLK(x) false
212 -#define readlink(s, t, l) (strcpy(t, s), strlen(t))
213  /*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
214  #define chdir _chdir2
215  #define strcasecmp stricmp
216 Index: lyx-devel/src/support/rename.C
217 ===================================================================
218 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/rename.C,v
219 retrieving revision 1.4
220 diff -u -r1.4 rename.C
221 --- lyx-devel/src/support/rename.C      2000/11/06 11:20:22     1.4
222 +++ lyx-devel/src/support/rename.C      2000/11/12 08:09:20
223 @@ -6,6 +6,9 @@
224  
225  bool lyx::rename(string const & from, string const & to)
226  {
227 +#ifdef __EMX__
228 +       ::unlink(to.c_str());
229 +#endif
230         if (::rename(from.c_str(), to.c_str()) == -1)
231                 return lyx::copy(from, to);
232         return true;
233 Index: lyx-devel/src/support/syscall.C
234 ===================================================================
235 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/syscall.C,v
236 retrieving revision 1.18
237 diff -u -r1.18 syscall.C
238 --- lyx-devel/src/support/syscall.C     2000/10/11 21:06:43     1.18
239 +++ lyx-devel/src/support/syscall.C     2000/11/12 08:09:21
240 @@ -15,6 +15,7 @@
241  #include "syscontr.h"
242  #include "support/lstrings.h"
243  #include "support/lyxlib.h"
244 +#include "support/filetools.h"
245  
246  using std::endl;
247