From bb0cb4db08103ccb12840275b162cfe8cc4501ce Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 22 Jun 1999 20:39:46 +0000 Subject: Based on patches from Mumit Khan : * configure.in: Define EXECUTABLE_SUFFIX. * dlltool.c: Include "dyn-string.h". Include based on ANSI_PROTOTYPES, not __STDC__. (outfile): Remove. (gen_exp_file): Change uses of outfile to use alloca. (make_one_lib_file, make_head, make_tail): Likewise. (gen_lib_file): Likewise. (look_for_prog): New static function. (deduce_name): Rewrite to use look_for_prog. (mcore_elf_gen_out_file): Use dyn_string_t rather than outfile. * dllwrap.c: Don't include , , , , or . Include and either or . (driver_name): Initialize to NULL, not "gcc". (dlltool_name): Initialize to NULL, not "dlltool". (display, inform, look_for_prog, deduce_name): New static functions. (usage): Mention -mno-cygwin. (OPTION_MNO_CYGWIN): Define. (main): Handle -mno-cygwin. Deduce driver_name and dlltool_name. * resrc.c (look_for_default): Make static. Remove unused local path. Check using EXECUTABLE_SUFFIX. (read_rc_file): Allocate enough space to hold EXECUTABLE_SUFFIX. * Makefile.am: Rebuild dependencies. (dllwrap_LDADD): Add $(INTLLIBS). * configure, Makefile.in, config.in: Rebuild. --- binutils/resrc.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'binutils/resrc.c') diff --git a/binutils/resrc.c b/binutils/resrc.c index 41c9cca..ed6a36a 100644 --- a/binutils/resrc.c +++ b/binutils/resrc.c @@ -1,5 +1,5 @@ /* resrc.c -- read and write Windows rc files. - Copyright 1997, 1998 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GNU Binutils. @@ -112,6 +112,8 @@ static int icons; /* Local functions. */ +static FILE *look_for_default PARAMS ((char *, const char *, int, + const char *, const char *)); static void close_pipe PARAMS ((void)); static void unexpected_eof PARAMS ((const char *)); static int get_word PARAMS ((FILE *, const char *)); @@ -122,41 +124,44 @@ static void define_fontdirs PARAMS ((void)); /* look for the preprocessor program */ -FILE * +static FILE * look_for_default (cmd, prefix, end_prefix, preprocargs, filename) char *cmd; - char *prefix; + const char *prefix; int end_prefix; - char *preprocargs; - char *filename; + const char *preprocargs; + const char *filename; { - char *path = getenv ("PATH"); char *space; int found; struct stat s; strcpy (cmd, prefix); - sprintf (cmd+end_prefix, "%s", DEFAULT_PREPROCESSOR); - space = strchr (cmd+end_prefix, ' '); + sprintf (cmd + end_prefix, "%s", DEFAULT_PREPROCESSOR); + space = strchr (cmd + end_prefix, ' '); if (space) *space = 0; if (strchr (cmd, '/')) { - found = stat (cmd, &s); + found = (stat (cmd, &s) == 0 +#ifdef EXECUTABLE_SUFFIX + || stat (strcat (cmd, EXECUTABLE_SUFFIX), &s) == 0 +#endif + ); - if (found < 0) + if (! found) { if (verbose) fprintf (stderr, "Tried `%s'\n", cmd); - return 0; + return NULL; } } strcpy (cmd, prefix); - sprintf (cmd+end_prefix, "%s %s %s", + sprintf (cmd + end_prefix, "%s %s %s", DEFAULT_PREPROCESSOR, preprocargs, filename); if (verbose) @@ -202,11 +207,14 @@ read_rc_file (filename, preprocessor, preprocargs, language) + strlen (preprocessor) + strlen (preprocargs) + strlen (filename) +#ifdef EXECUTABLE_SUFFIX + + strlen (EXECUTABLE_SUFFIX) +#endif + 10); dash = slash = 0; - for (cp=program_name; *cp; cp++) + for (cp = program_name; *cp; cp++) { if (*cp == '-') dash = cp; -- cgit v1.1