diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-25 02:49:56 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-25 02:49:56 +0000 |
commit | e2d3326da9456ae846b41aa50865fe0f36e1cb77 (patch) | |
tree | cc3f78e16bd61883bd851c64c73ab8ccd716a823 /gcc/protoize.c | |
parent | b99476d8779c76e61aa96b78a3123d3550a65e19 (diff) | |
download | gcc-e2d3326da9456ae846b41aa50865fe0f36e1cb77.tar.gz |
* Makefile.in (PREPROCESSOR_DEFINES): New macro.
(protoize.o): Use PREPROCESSOR_DEFINES and DRIVER_DEFINES.
(unprotoize.o): Ditto.
(test-protoize-simple): Don't define STD_PROTO_DIR.
* protoize.c: Use PARAMS rather than PROTO. Minor whitespace
changes to make 'test-protoize-simple' pass.
(STD_PROTO_DIR): Remove define.
(STANDARD_EXEC_PREFIX): Supply default define.
(standard_exec_prefix): New variable, init to STANDARD_EXEC_PREFIX.
(target_machine): New variable, init to DEFAULT_TARGET_MACHINE.
(target_version): New variable, init to DEFAULT_TARGET_VERSION.
(GET_ENV_PATH_LIST): New macro.
(default_syscalls_dir): No longer initialized to STD_PROTO_DIR.
(do_processing): Initialize default_syscalls_dir using new
macros. Use it to initialize syscalls_absolute_filename.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28832 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/protoize.c')
-rw-r--r-- | gcc/protoize.c | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/gcc/protoize.c b/gcc/protoize.c index 7e9205cb1a8..73a573ad5d4 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -111,9 +111,9 @@ extern char *version_string; extern char *getpwd (); -static void usage PROTO ((void)) ATTRIBUTE_NORETURN; -static void aux_info_corrupted PROTO ((void)) ATTRIBUTE_NORETURN; -static void declare_source_confusing PROTO ((const char *)) ATTRIBUTE_NORETURN; +static void usage PARAMS ((void)) ATTRIBUTE_NORETURN; +static void aux_info_corrupted PARAMS ((void)) ATTRIBUTE_NORETURN; +static void declare_source_confusing PARAMS ((const char *)) ATTRIBUTE_NORETURN; /* Aliases for pointers to void. These were made to facilitate compilation with old brain-dead DEC C @@ -165,9 +165,21 @@ extern size_t strlen () /* Define a default place to find the SYSCALLS.X file. */ -#ifndef STD_PROTO_DIR -#define STD_PROTO_DIR "/usr/local/lib" -#endif /* !defined (STD_PROTO_DIR) */ +#ifndef UNPROTOIZE + +#ifndef STANDARD_EXEC_PREFIX +#define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-lib/" +#endif /* !defined STANDARD_EXEC_PREFIX */ + +static char *standard_exec_prefix = STANDARD_EXEC_PREFIX; +static char *target_machine = DEFAULT_TARGET_MACHINE; +static char *target_version = DEFAULT_TARGET_VERSION; + +#ifndef GET_ENV_PATH_LIST +#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0) +#endif + +#endif /* !defined (UNPROTOIZE) */ /* Suffix of aux_info files. */ @@ -187,7 +199,7 @@ static const char syscalls_filename[] = "SYSCALLS.c"; /* Default place to find the above file. */ -static const char * const default_syscalls_dir = STD_PROTO_DIR; +static char * default_syscalls_dir; /* Variable to hold the complete absolutized filename of the SYSCALLS.c.X file. */ @@ -569,10 +581,10 @@ static char * saved_repl_write_ptr; static const char *shortpath (); /* Translate and output an error message. */ -static void notice PVPROTO ((const char *, ...)) +static void notice PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; static void -notice VPROTO ((const char *msgid, ...)) +notice VPARAMS ((const char *msgid, ...)) { #ifndef ANSI_PROTOTYPES const char *msgid; @@ -592,7 +604,7 @@ notice VPROTO ((const char *msgid, ...)) char * xstrerror(e) - int e; + int e; { #ifdef HAVE_STRERROR @@ -614,7 +626,7 @@ xstrerror(e) pointer_type xmalloc (byte_count) - size_t byte_count; + size_t byte_count; { register pointer_type rv = (pointer_type) malloc (byte_count); if (rv == NULL) @@ -4458,16 +4470,27 @@ do_processing () if (nondefault_syscalls_dir) { syscalls_absolute_filename - = (char *) xmalloc (strlen (nondefault_syscalls_dir) - + sizeof (syscalls_filename) + 1); + = (char *) xmalloc (strlen (nondefault_syscalls_dir) + 1 + + sizeof (syscalls_filename)); strcpy (syscalls_absolute_filename, nondefault_syscalls_dir); } else { + GET_ENV_PATH_LIST (default_syscalls_dir, "GCC_EXEC_PREFIX"); + if (!default_syscalls_dir) + { + default_syscalls_dir = standard_exec_prefix; + } syscalls_absolute_filename - = (char *) xmalloc (strlen (default_syscalls_dir) - + sizeof (syscalls_filename) + 1); + = (char *) xmalloc (strlen (default_syscalls_dir) + 0 + + strlen (target_machine) + 1 + + strlen (target_version) + 1 + + sizeof (syscalls_filename)); strcpy (syscalls_absolute_filename, default_syscalls_dir); + strcat (syscalls_absolute_filename, target_machine); + strcat (syscalls_absolute_filename, "/"); + strcat (syscalls_absolute_filename, target_version); + strcat (syscalls_absolute_filename, "/"); } syscalls_len = strlen (syscalls_absolute_filename); |