DJGPP support added

This commit is contained in:
Juan Manuel Guerrero
2002-02-13 16:13:31 +00:00
parent 9cbe3c4878
commit cc20bc3166
6 changed files with 96 additions and 16 deletions

View File

@@ -214,7 +214,7 @@ skeleton_find (const char *envvar, const char *skeleton_name)
{
const char *res = getenv (envvar);
#if defined (MSDOS) || defined (_WIN32)
#if (defined (MSDOS) && !defined(__DJGPP__)) || defined (_WIN32)
const char *cp = getenv ("INIT");
if (!res)
{
@@ -249,7 +249,7 @@ skeleton_find (const char *envvar, const char *skeleton_name)
strcpy (res + (cp - program_name), skel_name);
}
}
#endif /* defined (MSDOS) || defined (_WIN32) */
#endif /* (defined (MSDOS) && !defined (__DJGPP__)) || defined (_WIN32) */
if (!res)
res = skeleton_name;
@@ -452,9 +452,7 @@ compute_output_file_names (void)
spec_verbose_file = stringappend (short_base_name, EXT_OUTPUT);
attrsfile = stringappend (short_base_name, EXT_STYPE_H);
#ifndef MSDOS
attrsfile = stringappend (attrsfile, header_extension);
#endif /* MSDOS */
attrsfile = stringappend (attrsfile, EXT_TYPE (header_extension));
}
@@ -523,9 +521,7 @@ output_files (void)
obstack_save (&attrs_obstack, attrsfile);
obstack_free (&attrs_obstack, NULL);
temp_name = stringappend (short_base_name, EXT_GUARD_C);
#ifndef MSDOS
temp_name = stringappend (temp_name, src_extension);
#endif /* MSDOS */
temp_name = stringappend (temp_name, EXT_TYPE (src_extension));
obstack_save (&guard_obstack, temp_name);
obstack_free (&guard_obstack, NULL);
}

View File

@@ -160,10 +160,15 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
| Process the options. |
`----------------------*/
/* Under DOS, there is no difference on the case. This can be
/* Under plain DOS, there is no difference on the case. This can be
troublesome when looking for `.tab' etc. */
#ifdef MSDOS
# define AS_FILE_NAME(File) (strlwr (File), (File))
# if defined (__DJGPP__)
/* Windows 9X and successors are case sensitive. */
# define AS_FILE_NAME(File) ((pathconf ((File), _PC_NAME_MAX) > 12) ? (File) : (strlwr (File), (File)))
# else
# define AS_FILE_NAME(File) (strlwr (File), (File))
# endif
#else
# define AS_FILE_NAME(File) (File)
#endif

View File

@@ -239,7 +239,7 @@ do { \
# define MINSHORT -32768
#endif
#if defined (MSDOS) && !defined (__GO32__)
#if defined (MSDOS) && !defined (__GO32__) && !defined (__DJGPP__)
# define BITS_PER_WORD 16
# define MAXTABLE 16383
#else
@@ -261,19 +261,31 @@ do { \
# define EXT_OUTPUT ".output"
# define EXT_STYPE_H "_stype"
# define EXT_GUARD_C "_guard"
# define EXT_TYPE(ext) (ext)
#else /* ! VMS */
# ifdef MSDOS
/* MS DOS. */
# define EXT_TAB "_tab"
# define EXT_OUTPUT ".out"
# define EXT_STYPE_H ".sth"
# define EXT_GUARD_C ".guc"
# if defined (__DJGPP__)
/* DJGPP */
# define EXT_TAB ((pathconf (NULL, _PC_NAME_MAX) > 12) ? ".tab" : "_tab")
# define EXT_OUTPUT ((pathconf (NULL, _PC_NAME_MAX) > 12) ? ".output" : ".out")
# define EXT_STYPE_H ((pathconf (NULL, _PC_NAME_MAX) > 12) ? ".stype" : ".sth")
# define EXT_GUARD_C ((pathconf (NULL, _PC_NAME_MAX) > 12) ? ".guard" : ".guc")
# define EXT_TYPE(ext) ((pathconf (NULL, _PC_NAME_MAX) > 12) ? (ext) : "")
# else /* ! __DJGPP__ */
/* MS DOS. */
# define EXT_TAB "_tab"
# define EXT_OUTPUT ".out"
# define EXT_STYPE_H ".sth"
# define EXT_GUARD_C ".guc"
# define EXT_TYPE(ext) ""
# endif
# else /* ! MSDOS */
/* Standard. */
# define EXT_TAB ".tab"
# define EXT_OUTPUT ".output"
# define EXT_STYPE_H ".stype"
# define EXT_GUARD_C ".guard"
# define EXT_TYPE(ext) (ext)
# endif /* ! MSDOS */
#endif /* ! VMS */