2001-08-28  Guerrero, Juan Manuel  <st001906@hrz1.hrz.tu-darmstadt.de>

	* configure.bat: Obsolete. Removed

	* djgpp/config.bat: New file. DJGPP specific.

	* djgpp/config.sed: New file. DJGPP specific.

	* djgpp/config.site: New file. DJGPP specific.

	* djgpp/README: New file. DJGPP specific.

	* doc/bison.texinfo: Sub chapter about extension limitations
	  under plain DOS added.

	* src/files.c (compute_base_names): Macro MSDOS replaced
	  by macro NO_CASE_PRESERVE.
	  (output_files): MSDOS conditional removed. New macro EXT_TYPE
	  will provide at runtime the appropiate output file extension.

	* src/system.h [MSDOS] [__DJGPP__]: Use pathconf to choose POSIX or
	  DOS file extensions at run time.
	  [MSDOS] [__DJGPP__]: New macro NO_CASE_PRESERVE.  DJGPP is case
          preserving under Win9X.
	  [MSDOS] [__GO32__]: Macro __DJGPP__ added.  __GO32__ is obsolete
          and its use is deprecated.
	  [MSDOS] [__DJGPP__]: New macro EXT_TYPE. Determinates at runtime
	  the src file and header file extension string to be used. If LFN-API
	  is available, the src and header file extension will be added to the
	  output file name. If no LFN-API is available no extension at all
	  will be added to the output file name.
	  [MSDOS] [!__DJGPP__]: New macro EXT_TYPE. The src file and header
          file extension strings default to empty. No extension will be
	  added to the output file name at all.
	  [!MSDOS]: New macro EXT_TYPE. The src file and header file
	  extensions will always be added to the output file name.




diff -acprNC5 bison-1.29.orig/doc/bison.texinfo bison-1.29.djgpp/doc/bison.texinfo
*** bison-1.29.orig/doc/bison.texinfo	Wed Aug 29 12:19:44 2001
--- bison-1.29.djgpp/doc/bison.texinfo	Mon Sep 10 22:36:50 2001
*************** Handling Context Dependencies
*** 302,311 ****
--- 302,313 ----
  Invoking Bison
  
  * Bison Options::     All the options described in detail,
  			in alphabetical order by short options.
  * Option Cross Key::  Alphabetical list of long options.
+ * Extension Limitations Under DOS::  Bison output files extension differences
+ 					depending on the DOS/Windows file system flavour used.
  * VMS Invocation::    Bison command syntax on VMS.
  
  Copying This Manual
  
  * GNU Free Documentation License::  License for copying this manual.
*************** will produce @file{output.c++} and @file
*** 4987,4996 ****
--- 4989,5000 ----
  @menu
  * Bison Options::     All the options described in detail,
  			in alphabetical order by short options.
  * Environment Variables::  Variables which affect Bison execution.
  * Option Cross Key::  Alphabetical list of long options.
+ * Extension Limitations Under DOS::  Bison output files extension differences
+ 					depending on the DOS/Windows file system flavour used.
  * VMS Invocation::    Bison command syntax on VMS.
  @end menu
  
  @node Bison Options
  @section Bison Options
*************** the corresponding short option.
*** 5183,5192 ****
--- 5187,5226 ----
  --verbose                             -v
  --version                             -V
  @end example
  @end ifinfo
  
+ @node Extension Limitations Under DOS
+ @section Extension Limitations under DOS
+ @cindex extension limitations under DOS
+ @cindex DOS
+ 
+ On DOS/Windows 9X systems, the file name extensions, like @file{.tab.c},
+ that may be used depend on the file system used.  The plain DOS file system
+ has limited file name length and does not allow more than a single dot
+ in the file name.
+ 
+ The DJGPP port of @code{bison} will detect at runtime if (LFN) long file name
+ support is available or not.  LFN support will be available in a DOS session
+ under Windows 9X and successors.  If LFN support is available the DJGPP port
+ of @code{bison} will use the standard POSIX file name extensions.  If LFN
+ support is not available, then the DJGPP port of @code{bison} will use
+ DOS specific file name extensions.
+ 
+ @noindent This table summarizes the used extensions:
+ 
+ @multitable @columnfractions 0.1 0.45 0.45
+ @item @tab LFN extension (Win9X) @tab SFN extension (plain DOS)
+ @item @tab @file{.tab.c} @tab @file{_tab.c}
+ @item @tab @file{.tab.h} @tab @file{_tab.h}
+ @item @tab @file{.tab.cpp} @tab @file{_tab.cpp}
+ @item @tab @file{.tab.hpp} @tab @file{_tab.hpp}
+ @item @tab @file{.output} @tab @file{.out}
+ @item @tab @file{.stype.h} @tab @file{.sth}
+ @item @tab @file{.guard.c} @tab @file{.guc}
+ @end multitable
+ 
  @node VMS Invocation
  @section Invoking Bison under VMS
  @cindex invoking Bison under VMS
  @cindex VMS
  
diff -acprNC5 bison-1.29.orig/src/files.c bison-1.29.djgpp/src/files.c
*** bison-1.29.orig/src/files.c	Wed Aug 15 08:53:14 2001
--- bison-1.29.djgpp/src/files.c	Mon Sep 10 19:33:28 2001
*************** compute_base_names (void)
*** 305,317 ****
  
       The precise -o name will be used for FTABLE.  For other output
       files, remove the ".c" or ".tab.c" suffix.  */
    if (spec_outfile)
      {
! #ifdef MSDOS
        strlwr (spec_outfile);
! #endif /* MSDOS */
        /* BASE_LENGTH includes ".tab" but not ".c".  */
        base_length = strlen (spec_outfile);
  
        ext_index = get_extension_index (spec_outfile);
        /* If the initial segment of extension contains 'c' or a 'C', I assume
--- 305,317 ----
  
       The precise -o name will be used for FTABLE.  For other output
       files, remove the ".c" or ".tab.c" suffix.  */
    if (spec_outfile)
      {
! #ifdef NO_CASE_PRESERVE
        strlwr (spec_outfile);
! #endif /* NO_CASE_PRESERVE */
        /* BASE_LENGTH includes ".tab" but not ".c".  */
        base_length = strlen (spec_outfile);
  
        ext_index = get_extension_index (spec_outfile);
        /* If the initial segment of extension contains 'c' or a 'C', I assume
*************** compute_base_names (void)
*** 339,351 ****
       are `foo'.
  
       Construct names from it.  */
    if (spec_file_prefix)
      {
! #ifdef MSDOS
        strlwr (spec_file_prefix);
! #endif /* MSDOS */
        short_base_name = xstrdup (spec_file_prefix);
        base_name = XMALLOC (char,
  			   strlen (short_base_name) + strlen (EXT_TAB) + 1);
        stpcpy (stpcpy (base_name, short_base_name), EXT_TAB);
  
--- 339,351 ----
       are `foo'.
  
       Construct names from it.  */
    if (spec_file_prefix)
      {
! #ifdef NO_CASE_PRESERVE
        strlwr (spec_file_prefix);
! #endif /* NO_CASE_PRESERVE */
        short_base_name = xstrdup (spec_file_prefix);
        base_name = XMALLOC (char,
  			   strlen (short_base_name) + strlen (EXT_TAB) + 1);
        stpcpy (stpcpy (base_name, short_base_name), EXT_TAB);
  
*************** output_files (void)
*** 433,445 ****
      src_extension = ".c";
    if (!header_extension)
      header_extension = ".h";
  
    attrsfile = stringappend (short_base_name, EXT_STYPE_H);
! #ifndef MSDOS
!   stringappend (attrsfile, header_extension);
! #endif /* MSDOS */
  
    /* Output the main file.  */
    if (spec_outfile)
      obstack_save (&table_obstack, spec_outfile);
    else
--- 433,443 ----
      src_extension = ".c";
    if (!header_extension)
      header_extension = ".h";
  
    attrsfile = stringappend (short_base_name, EXT_STYPE_H);
!   stringappend (attrsfile, EXT_TYPE (header_extension));
  
    /* Output the main file.  */
    if (spec_outfile)
      obstack_save (&table_obstack, spec_outfile);
    else
*************** output_files (void)
*** 459,471 ****
      {
        char *temp_name;
  
        obstack_save (&attrs_obstack, attrsfile);
        temp_name = stringappend (short_base_name, EXT_GUARD_C);
! #ifndef MSDOS
!       temp_name = stringappend (temp_name, src_extension);
! #endif /* MSDOS */
        obstack_save (&guard_obstack, temp_name);
      }
  
    if (verbose_flag)
      /* We used to use just .out if spec_name_prefix (-p) was used, but
--- 457,467 ----
      {
        char *temp_name;
  
        obstack_save (&attrs_obstack, attrsfile);
        temp_name = stringappend (short_base_name, EXT_GUARD_C);
!       temp_name = stringappend (temp_name, EXT_TYPE (src_extension));
        obstack_save (&guard_obstack, temp_name);
      }
  
    if (verbose_flag)
      /* We used to use just .out if spec_name_prefix (-p) was used, but
diff -acprNC5 bison-1.29.orig/src/system.h bison-1.29.djgpp/src/system.h
*** bison-1.29.orig/src/system.h	Fri Aug 10 09:35:50 2001
--- bison-1.29.djgpp/src/system.h	Mon Sep 10 19:33:24 2001
*************** do {								\
*** 207,217 ****
  #else
  # define	MAXSHORT	32767
  # define	MINSHORT	-32768
  #endif
  
! #if defined (MSDOS) && !defined (__GO32__)
  # define	BITS_PER_WORD	16
  # define MAXTABLE	16383
  #else
  # define	BITS_PER_WORD	32
  # define MAXTABLE	32767
--- 207,217 ----
  #else
  # define	MAXSHORT	32767
  # define	MINSHORT	-32768
  #endif
  
! #if defined (MSDOS) && !defined (__GO32__) && !defined (__DJGPP__)
  # define	BITS_PER_WORD	16
  # define MAXTABLE	16383
  #else
  # define	BITS_PER_WORD	32
  # define MAXTABLE	32767
*************** do {								\
*** 229,251 ****
    /* VMS. */
  # define EXT_TAB	"_tab"
  # define EXT_OUTPUT	".output"
  # define EXT_STYPE_H	"_stype"
  # define EXT_GUARD_C	"_guard"
  #else /* ! VMS */
  # ifdef MSDOS
!    /* MS DOS. */
! #  define EXT_TAB	"_tab"
! #  define EXT_OUTPUT	".out"
! #  define EXT_STYPE_H	".sth"
! #  define EXT_GUARD_C	".guc"
  # else /* ! MSDOS */
    /* Standard. */
  #  define EXT_TAB	".tab"
  #  define EXT_OUTPUT	".output"
  #  define EXT_STYPE_H	".stype"
  #  define EXT_GUARD_C	".guard"
  # endif /* ! MSDOS */
  #endif /* ! VMS */
  
  #if defined (VMS) & !defined (__VMS_POSIX)
  # ifndef BISON_SIMPLE
--- 229,263 ----
    /* VMS. */
  # define EXT_TAB	"_tab"
  # define EXT_OUTPUT	".output"
  # define EXT_STYPE_H	"_stype"
  # define EXT_GUARD_C	"_guard"
+ # define EXT_TYPE(ext)	(ext)
  #else /* ! VMS */
  # ifdef MSDOS
! #  ifdef __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 */
  
  #if defined (VMS) & !defined (__VMS_POSIX)
  # ifndef BISON_SIMPLE
*************** do {								\
*** 262,266 ****
--- 274,282 ----
  # endif
  # ifndef BISON_HAIRY
  #  define BISON_HAIRY "c:/usr/local/lib/bison.hairy"
  # endif
  #endif
+ 
+ #if defined (MSDOS) && !defined (__DJGPP__)
+ # define NO_CASE_PRESERVE
+ #endif
