Mail Archives: djgpp/1994/03/17/03:04:17
Jean Michel RICHER
University of BOURGOGNE, Dijon (France)
dea3 AT depinfo DOT u-bourgogne DOT fr
Hi,
I am a student in computer science and I work at the University
under UNIX on HP apollo machines, and I got a computer working under
MSDOS at home. I'd like to be able to use the programs I write at
the University at home. Especially I'd like to be able to use the
Flex and Bison which are very powerful.
I get the DJGPP package containing DJDEV110.ZIP and other files
but I can't use the Flex or the Bison because the file names are given
with UNIX format using '/'.
So I tried to unzip the source files but they are the GNU files
that are hardly compatible under DOS without a mountain of changes.
-------------------------------------------------------------------
My purpose is to deal about the portability of GNU tools under
MSDOS.
--------------------------------------------------------------------
It seems a real nightmare : I wonder if the people who created
the Bison or Flex or any GNU tool have ever heard about
software engeneering, modularity,or any basic concept of programmation !!!
The conversion of UNIX-GNU-tools to MSDOS seems impossible or at
least very hard because of the following reasons :
- the file names always appear with the / symbol where as DOS uses /.
- the DOS C compilers produce errors when the extern variables are
declared in include files and are then declared in .c files.
- the prototypes are generally given in a non-ansi form : so it is
necessary to rewrite all procedures and functions in an ansi way.
- the modules are sometimes too big, or uses too many include files
to be compiled : I had problems with the flex parser file, I had
to split it in one file containing the tables, and another contain-
ing the parser code.
------------------------
So I would like to suggest the use of the following macros and
methods to rewrite GNU tools, so that they can be compiled and used
under MSDOS :
- declaration of macros :
#define _MSDOS_ when working with MSDOS
#define _UNIX_ when working with UNIX
#define _PROTO_ when using prototypes or ansi declarations
#define _DEBUG_ when debugging programs
- directories :
c:\gnu directory of gnu tools
c:\gnu\bin binaries (bison.exe, flex.exe, gcc.exe)
c:\gnu\bin\bison bison files (bison.hairy)
- declaration of procedures :
.h file :
#ifdef _PROTO_
void *malloc (size_t size);
...
#else
void *malloc ( );
...
#endif
.c file :
#ifdef _PROTO_
void *malloc (size_t size)
#else
void *malloc (size)
size_t size;
#endif
{
<body>
}
- declaration of file names :
#ifdef _UNIX_
char *hairy_bison [] = "bison.hairy";
#else /* not UNIX, so MSDOS */
char *hairy_bison [] = "c:\gnu\bin\bison\bison.hai";
#endif
- definition of libraries that are DOS-UNIX compatibles :
for example the possibility of using the DOS 'fnsplit'
and 'fnmerge' procedures with UNIX.
I hope you'll take in account my suggests so that many people
working under DOS could benefit from the power of UNIX-GNU tools.
Syncerely Yours,
John Michael RICHER.
- Raw text -