]> git.lyx.org Git - lyx.git/blob - development/OS2/quick_fix.patch
fix typo that put too many include paths for most people
[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        2001/01/01 01:09:00
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.17
47 diff -u -r1.17 configure.m4
48 --- lyx-devel/lib/configure.m4  2000/11/21 15:45:42     1.17
49 +++ lyx-devel/lib/configure.m4  2001/01/01 01:09:05
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 \$\$i"
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    2001/01/01 01:09:06
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    2001/01/01 01:09:06
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/os2_defines.h
154 ===================================================================
155 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/os2_defines.h,v
156 retrieving revision 1.5
157 diff -u -r1.5 os2_defines.h
158 --- lyx-devel/src/os2_defines.h 2000/11/08 09:39:44     1.5
159 +++ lyx-devel/src/os2_defines.h 2001/01/01 01:09:07
160 @@ -13,16 +13,22 @@
161  #ifndef OS2_DEFINES_H
162  #define OS2_DEFINES_H
163  
164 +#if defined (__cplusplus)
165  #include <cctype>
166 -#include <process.h>
167  #include <cstdlib>
168 +extern "C" inline int readlink(const char *, char *, size_t) {return -1;}
169 +#else
170 +#include <ctype.h>
171 +#include <stdlib.h>
172 +#define readlink(s, t, l) (-1)
173 +#endif
174 +#include <process.h>
175  #include <unistd.h>
176  #include <X11/Xlocale.h>
177  /* #include <malloc.h> */
178  #define lstat stat
179  #define S_ISLNK(x) false
180  #define S_ISBLK(x) false
181 -#define readlink(s, t, l) (strcpy(t, s), strlen(t))
182  /*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
183  #define chdir _chdir2
184  #define strcasecmp stricmp
185 Index: lyx-devel/src/support/rename.C
186 ===================================================================
187 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/rename.C,v
188 retrieving revision 1.5
189 diff -u -r1.5 rename.C
190 --- lyx-devel/src/support/rename.C      2000/11/13 10:35:02     1.5
191 +++ lyx-devel/src/support/rename.C      2001/01/01 01:09:10
192 @@ -6,6 +6,9 @@
193  
194  bool lyx::rename(string const & from, string const & to)
195  {
196 +#ifdef __EMX__
197 +       ::unlink(to.c_str());
198 +#endif
199         if (::rename(from.c_str(), to.c_str()) == -1)
200                 if (lyx::copy(from, to)) {
201                         lyx::unlink(from);
202 Index: lyx-devel/src/support/syscall.C
203 ===================================================================
204 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/syscall.C,v
205 retrieving revision 1.18
206 diff -u -r1.18 syscall.C
207 --- lyx-devel/src/support/syscall.C     2000/10/11 21:06:43     1.18
208 +++ lyx-devel/src/support/syscall.C     2001/01/01 01:09:10
209 @@ -15,6 +15,7 @@
210  #include "syscontr.h"
211  #include "support/lstrings.h"
212  #include "support/lyxlib.h"
213 +#include "support/filetools.h"
214  
215  using std::endl;
216  
217 Index: lyx-devel/src/support/tempname.C
218 ===================================================================
219 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/tempname.C,v
220 retrieving revision 1.4
221 diff -u -r1.4 tempname.C
222 --- lyx-devel/src/support/tempname.C    2000/11/15 03:22:08     1.4
223 +++ lyx-devel/src/support/tempname.C    2001/01/01 01:09:10
224 @@ -12,6 +12,17 @@
225  
226  extern string system_tempdir;
227  
228 +#ifdef __EMX__
229 +       // EMX mkstemp() behaviour may be problematic, however,
230 +       // as noted by Lgb in the comment to CreateTmpDir(),
231 +       // there is no point for using mkstemp() here.
232 +#undef HAVE_MKSTEMP
233 +#include <sys/types.h>
234 +#include <sys/stat.h>
235 +#define INCL_DOSFILEMGR
236 +#include <os2.h>
237 +#endif
238 +
239  static inline
240  int make_tempfile(char * templ) 
241  {
242 @@ -19,9 +30,14 @@
243         return ::mkstemp(templ);
244  #else
245  #ifdef HAVE_MKTEMP
246 +#ifdef __EMX__
247 +       ULONG cur = 0;
248 +       LONG  req = 1;
249 +       DosSetRelMaxFH(&req, &cur);     // No need to check error code.
250 +#endif
251         // This probably just barely works...
252         ::mktemp(templ);
253 -       return ::open(templ, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
254 +       return ::open(templ, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
255  #else
256  #warning FIX FIX FIX
257  #endif