Commit a7db8bbb by Mumit Khan Committed by Jeff Law

protoize.c: (AUX_INFO_SUFFIX): New macro.

        * protoize.c: (AUX_INFO_SUFFIX): New macro.
        (aux_info_suffix): Use.
        (SAVE_SUFFIX): New macro.
        (save_suffix): Use.
        (munge_compile_parms): Fix typo in NUL. DJGPP supports /dev/null.
        (gen_aux_info_file): Use aux_info_suffix instead of ".X".
        (edit_file): Handle 8.3 restriction for DOS/DJGPP filenames.

        * invoke.texi (Running Protoize): Update documentation.

From-SVN: r32170
parent 3431f196
2000-02-25 Mumit Khan <khan@xraylith.wisc.edu>
* protoize.c: (AUX_INFO_SUFFIX): New macro.
(aux_info_suffix): Use.
(SAVE_SUFFIX): New macro.
(save_suffix): Use.
(munge_compile_parms): Fix typo in NUL. DJGPP supports /dev/null.
(gen_aux_info_file): Use aux_info_suffix instead of ".X".
(edit_file): Handle 8.3 restriction for DOS/DJGPP filenames.
* invoke.texi (Running Protoize): Update documentation.
2000-02-25 Mark Elbrecht <snowball3@bigfoot.com> 2000-02-25 Mark Elbrecht <snowball3@bigfoot.com>
* i386/djgpp.h (CPP_PREDEFINES): Remove Unix defines. * i386/djgpp.h (CPP_PREDEFINES): Remove Unix defines.
......
...@@ -7525,8 +7525,9 @@ with @samp{-q}. ...@@ -7525,8 +7525,9 @@ with @samp{-q}.
The output from @code{protoize} or @code{unprotoize} replaces the The output from @code{protoize} or @code{unprotoize} replaces the
original source file. The original file is renamed to a name ending original source file. The original file is renamed to a name ending
with @samp{.save}. If the @samp{.save} file already exists, then with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
the source file is simply discarded. without the original @samp{.c} suffix). If the @samp{.save} (@samp{.sav}
for DOS) file already exists, then the source file is simply discarded.
@code{protoize} and @code{unprotoize} both depend on GCC itself to @code{protoize} and @code{unprotoize} both depend on GCC itself to
scan the program and collect information about the functions it uses. scan the program and collect information about the functions it uses.
...@@ -7559,8 +7560,8 @@ would produce the wrong kind of output. These include @samp{-g}, ...@@ -7559,8 +7560,8 @@ would produce the wrong kind of output. These include @samp{-g},
the @var{compilation-options}, they are ignored. the @var{compilation-options}, they are ignored.
@item -C @item -C
Rename files to end in @samp{.C}, or @samp{.cc} for DOS-based file Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
systems, instead of @samp{.c}. This is convenient if you are converting systems) instead of @samp{.c}. This is convenient if you are converting
a C program to C++. This option applies only to @code{protoize}. a C program to C++. This option applies only to @code{protoize}.
@item -g @item -g
......
...@@ -47,6 +47,20 @@ Boston, MA 02111-1307, USA. */ ...@@ -47,6 +47,20 @@ Boston, MA 02111-1307, USA. */
#define IS_SAME_PATH(a,b) (strcmp (a, b) == 0) #define IS_SAME_PATH(a,b) (strcmp (a, b) == 0)
#endif #endif
/* Suffix for aux-info files. */
#ifdef __MSDOS__
#define AUX_INFO_SUFFIX "X"
#else
#define AUX_INFO_SUFFIX ".X"
#endif
/* Suffix for saved files. */
#ifdef __MSDOS__
#define SAVE_SUFFIX "sav"
#else
#define SAVE_SUFFIX ".save"
#endif
/* Suffix for renamed C++ files. */ /* Suffix for renamed C++ files. */
#ifdef HAVE_DOS_BASED_FILE_SYSTEM #ifdef HAVE_DOS_BASED_FILE_SYSTEM
#define CPLUS_FILE_SUFFIX "cc" #define CPLUS_FILE_SUFFIX "cc"
...@@ -117,11 +131,11 @@ static const char * const target_version = DEFAULT_TARGET_VERSION; ...@@ -117,11 +131,11 @@ static const char * const target_version = DEFAULT_TARGET_VERSION;
/* Suffix of aux_info files. */ /* Suffix of aux_info files. */
static const char * const aux_info_suffix = ".X"; static const char * const aux_info_suffix = AUX_INFO_SUFFIX;
/* String to attach to filenames for saved versions of original files. */ /* String to attach to filenames for saved versions of original files. */
static const char * const save_suffix = ".save"; static const char * const save_suffix = SAVE_SUFFIX;
/* String to attach to C filenames renamed to C++. */ /* String to attach to C filenames renamed to C++. */
...@@ -1983,8 +1997,8 @@ munge_compile_params (params_list) ...@@ -1983,8 +1997,8 @@ munge_compile_params (params_list)
temp_params[param_count++] = "-S"; temp_params[param_count++] = "-S";
temp_params[param_count++] = "-o"; temp_params[param_count++] = "-o";
#if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN)) #if defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN)
temp_params[param_count++] = "NUL:"; temp_params[param_count++] = "NUL";
#else #else
temp_params[param_count++] = "/dev/null"; temp_params[param_count++] = "/dev/null";
#endif #endif
...@@ -2018,7 +2032,7 @@ gen_aux_info_file (base_filename) ...@@ -2018,7 +2032,7 @@ gen_aux_info_file (base_filename)
compile_params[input_file_name_index] = shortpath (NULL, base_filename); compile_params[input_file_name_index] = shortpath (NULL, base_filename);
/* Add .X to source file name to get aux-info file name. */ /* Add .X to source file name to get aux-info file name. */
compile_params[aux_info_file_name_index] = compile_params[aux_info_file_name_index] =
concat (compile_params[input_file_name_index], ".X", NULL); concat (compile_params[input_file_name_index], aux_info_suffix, NULL);
if (!quiet_flag) if (!quiet_flag)
notice ("%s: compiling `%s'\n", notice ("%s: compiling `%s'\n",
...@@ -4316,6 +4330,11 @@ edit_file (hp) ...@@ -4316,6 +4330,11 @@ edit_file (hp)
= (char *) xmalloc (strlen (convert_filename) + strlen (save_suffix) + 2); = (char *) xmalloc (strlen (convert_filename) + strlen (save_suffix) + 2);
strcpy (new_filename, convert_filename); strcpy (new_filename, convert_filename);
#ifdef __MSDOS__
/* MSDOS filenames are restricted to 8.3 format, so we save `foo.c'
as `foo.<save_suffix>'. */
new_filename[(strlen (convert_filename) - 1] = '\0';
#endif
strcat (new_filename, save_suffix); strcat (new_filename, save_suffix);
/* Don't overwrite existing file. */ /* Don't overwrite existing file. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment