no, but i have successfully compiled with mingw, if that is of any help :)
(i don't know if you can use the win32api headers with cygwin gcc, but if you can,
it should be pretty much the same)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made this little makefile (not very tested, but it worked fine for me)
Ugly hack ahead, I found that defining BCPP as the compiler included all the right
headers.
It also depends on changing lines 49 and 50 in CON_NT.CPP from
--
static Initialized = 0;
static MousePresent = 0;
--
to
--
static int Initialized = 0;
static int MousePresent = 0;
--
(I have found this to be necessary in order to compile with any gcc 2.95.2 port.)
And here is the makefile
--fte-mngw.mak--
# depends on changes to con_nt.cpp
#
# -DBCPP works to include correct headers
i'll bundle up some stuff and mail it to you. i've also created a win32 makefile for
more recent borland compilers, and i've fixed a bug in the dos code that
interestingly enough prevented keyboard input in some cases :)
i'll write a more descriptive README
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks! Using the mingw that comes with cygwin, I'm able to get fte to compile and run, but it can't open any files (a somewhat important ability for a text editor to have :). I don't know yet if it's a problem with cygwin, mingw, or something I'm doing. I'll investigate it some more when I get time.
On another topic, what is the best way to submit patches?
Thanks,
Jason
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ah, I suspect you may be having a problem with the path separator.
When target is defined as NT, PATHTYPE will be defined as PT_DOSISH, while
the cygwin environment possibly needs PT_UNIXISH. try commenting out lines
155 thru 159 in sysdep.h, and inserting #define PATHTYPE PT_UNIXISH instead.
don't know if this will solve your problem, but it should be worth a try.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It looks like the stat that comes with cygwin's mingw is broken -- whenever I stat a directory, the st_mode field is always 0. This is what keeps fte (and cfte) from loading files. Here's a small test program:
Sorry for enormous responetime, I had some trouble connecting to
sourceforge.net earlier.
Anyway, with those single backslashes, your code won't compile at all.
replacing with double backslashes or ordinary unixish slashes, the code
compiles on native mingw (gcc -o test test.c) and outputs:
I've been having problems connecting to sourceforge, too. And it seems to have stripped out a backslash in the email too -- 2 backslashes: \\
Anyway, I finally got it to work. You have to define __MSVC__ to get stat to work, and you need to install some extra stuff to get C++ to work. I'll write up everything I did to get it working and submit it to the patches section. Thanks for all your help!
Jason
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Has anybody tried to get fte to compile under cygwin?
no, but i have successfully compiled with mingw, if that is of any help :)
(i don't know if you can use the win32api headers with cygwin gcc, but if you can,
it should be pretty much the same)
I'll give it a try. Did you do anything special to compile with mingw?
I made this little makefile (not very tested, but it worked fine for me)
Ugly hack ahead, I found that defining BCPP as the compiler included all the right
headers.
It also depends on changing lines 49 and 50 in CON_NT.CPP from
--
static Initialized = 0;
static MousePresent = 0;
--
to
--
static int Initialized = 0;
static int MousePresent = 0;
--
(I have found this to be necessary in order to compile with any gcc 2.95.2 port.)
And here is the makefile
--fte-mngw.mak--
# depends on changes to con_nt.cpp
#
# -DBCPP works to include correct headers
INCDIR =
LIBDIR =
OPTIMIZE = -O -s
MT = -Zmt
CC = gcc
LD = gcc
OEXT=o
DEFS=-DNT -DNTCONSOLE -DBCPP
CCFLAGS = $(OPTIMIZE) -x c++ -Wall $(DEFS) $(INCDIR) -pipe
LDFLAGS = $(OPTIMIZE) $(LIBDIR)
.SUFFIXES: .cpp .$(OEXT)
include objs.inc
.cpp.$(OEXT):
$(CC) $(CCFLAGS) -c $<
.c.$(OEXT):
$(CC) $(CCFLAGS) -c $<
all: cfte.exe fte.exe
# don't know how to use .def files on gcc, commented out
cfte.exe: $(CFTE_OBJS) # cfte.def
$(LD) $(LDFLAGS) $(CFTE_OBJS) -o cfte.exe $(LIBS)
defcfg.cnf: defcfg.fte cfte.exe
cfte defcfg.fte defcfg.cnf
defcfg.h: defcfg.cnf bin2c.exe
bin2c defcfg.cnf >defcfg.h
bin2c.exe: bin2c.cpp
$(CC) $(CCFLAGS) bin2c.cpp -o bin2c.exe
c_config.$(OEXT): defcfg.h
fte.exe: $(OBJS) $(NTOBJS) # fte.def
$(LD) $(LDFLAGS) $(OBJS) $(NTOBJS) -o fte.exe $(LIBS)
------
Those changes to the source code are quite important. They actually should be made to con_os2.cpp as well.
Those are now checked in so you don't need to continue making those changes.
As for the makefile, send it to me as a file attach or something so I can check it in for others to use.
con_dosx.cpp also needs to be fixed.
i'll bundle up some stuff and mail it to you. i've also created a win32 makefile for
more recent borland compilers, and i've fixed a bug in the dos code that
interestingly enough prevented keyboard input in some cases :)
i'll write a more descriptive README
Thanks! Using the mingw that comes with cygwin, I'm able to get fte to compile and run, but it can't open any files (a somewhat important ability for a text editor to have :). I don't know yet if it's a problem with cygwin, mingw, or something I'm doing. I'll investigate it some more when I get time.
On another topic, what is the best way to submit patches?
Thanks,
Jason
Ah, I suspect you may be having a problem with the path separator.
When target is defined as NT, PATHTYPE will be defined as PT_DOSISH, while
the cygwin environment possibly needs PT_UNIXISH. try commenting out lines
155 thru 159 in sysdep.h, and inserting #define PATHTYPE PT_UNIXISH instead.
don't know if this will solve your problem, but it should be worth a try.
It looks like the stat that comes with cygwin's mingw is broken -- whenever I stat a directory, the st_mode field is always 0. This is what keeps fte (and cfte) from loading files. Here's a small test program:
--- test.c ---
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
int main (int argc, char *argv[]) {
char path[256];
struct stat statbuf;
stat ("C:\\cygwin\\usr", &statbuf);
printf ("mode = %d\n", statbuf.st_mode);
stat ("C:\\cygwin\\usr\\", &statbuf);
printf ("mode = %d\n", statbuf.st_mode);
stat ("/usr", &statbuf);
printf ("mode = %d\n", statbuf.st_mode);
_fullpath (path, "test.c", 255);
stat (path, &statbuf);
printf ("mode = %d\n", statbuf.st_mode);
return 0;
}
---
I compiled this with this command:
gcc -o test test.c -mno-cygwin
And the output:
$ ./test.exe
mode = 0
Can you try compiling this and tell me what you get?
Thanks,
Jason
Sorry for enormous responetime, I had some trouble connecting to
sourceforge.net earlier.
Anyway, with those single backslashes, your code won't compile at all.
replacing with double backslashes or ordinary unixish slashes, the code
compiles on native mingw (gcc -o test test.c) and outputs:
--
mode = 16895
mode = 16895
mode = 16895
mode = 33206
--
(this provided that all directories exist, and test.c is in cwd of course)
I've been having problems connecting to sourceforge, too. And it seems to have stripped out a backslash in the email too -- 2 backslashes: \\
Anyway, I finally got it to work. You have to define __MSVC__ to get stat to work, and you need to install some extra stuff to get C++ to work. I'll write up everything I did to get it working and submit it to the patches section. Thanks for all your help!
Jason