From 2481e6a24fbcf780f29ea9098600271347df57e3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 22 Jun 1999 22:50:22 +0000 Subject: [PATCH] 1999-06-23 Mumit Khan * configure.in (HAVE_EXECUTABLE_SUFFIX): Define. * dlltool.c (look_for_prog): Use HAVE_EXECUTABLE_SUFFIX. * dllwrap.c (look_for_prog): Likewise. * resrc.c (look_for_default): Likewise. * configure, config.in: Rebuild. --- binutils/ChangeLog | 8 +++ binutils/config.in | 3 ++ binutils/configure | 116 ++++++++++++++++++++++-------------------- binutils/configure.in | 4 ++ binutils/dlltool.c | 6 +-- binutils/dllwrap.c | 6 +-- binutils/resrc.c | 4 +- 7 files changed, 84 insertions(+), 63 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 94daa90f76..9c8e51109d 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,11 @@ +1999-06-23 Mumit Khan + + * configure.in (HAVE_EXECUTABLE_SUFFIX): Define. + * dlltool.c (look_for_prog): Use HAVE_EXECUTABLE_SUFFIX. + * dllwrap.c (look_for_prog): Likewise. + * resrc.c (look_for_default): Likewise. + * configure, config.in: Rebuild. + 1999-06-22 Ian Lance Taylor Based on patches from Mumit Khan : diff --git a/binutils/config.in b/binutils/config.in index 4f630b82de..3c26c5c509 100644 --- a/binutils/config.in +++ b/binutils/config.in @@ -151,6 +151,9 @@ /* Define as 1 if you have gettext and don't want to use GNU gettext. */ #undef HAVE_GETTEXT +/* Does the platform use an executable suffix? */ +#undef HAVE_EXECUTABLE_SUFFIX + /* Suffix used for executables, if any. */ #undef EXECUTABLE_SUFFIX diff --git a/binutils/configure b/binutils/configure index d441fffbc4..d91582c39f 100755 --- a/binutils/configure +++ b/binutils/configure @@ -4174,6 +4174,12 @@ test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT +if test -n "$EXEEXT"; then + cat >> confdefs.h <<\EOF +#define HAVE_EXECUTABLE_SUFFIX 1 +EOF + +fi cat >> confdefs.h <&6 -echo "configure:4195: checking for $ac_word" >&5 +echo "configure:4201: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4230,7 +4236,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:4234: checking for a BSD compatible install" >&5 +echo "configure:4240: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4297,7 +4303,7 @@ if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' else echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 -echo "configure:4301: checking for build system executable suffix" >&5 +echo "configure:4307: checking for build system executable suffix" >&5 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4322,17 +4328,17 @@ for ac_hdr in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4326: checking for $ac_hdr" >&5 +echo "configure:4332: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4359,12 +4365,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:4363: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:4369: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4380,7 +4386,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:4384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -4403,19 +4409,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:4407: checking for working alloca.h" >&5 +echo "configure:4413: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -4436,12 +4442,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4440: checking for alloca" >&5 +echo "configure:4446: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4501,12 +4507,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4505: checking whether alloca needs Cray hooks" >&5 +echo "configure:4511: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4535: checking for $ac_func" >&5 +echo "configure:4541: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4586,7 +4592,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4590: checking stack direction for C alloca" >&5 +echo "configure:4596: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4594,7 +4600,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4637,12 +4643,12 @@ fi for ac_func in sbrk utimes do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4641: checking for $ac_func" >&5 +echo "configure:4647: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4693,14 +4699,14 @@ done # Some systems have frexp only in -lm, not in -lc. echo $ac_n "checking for library containing frexp""... $ac_c" 1>&6 -echo "configure:4697: checking for library containing frexp" >&5 +echo "configure:4703: checking for library containing frexp" >&5 if eval "test \"`echo '$''{'ac_cv_search_frexp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_frexp="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_frexp="none required" else @@ -4722,7 +4728,7 @@ rm -f conftest* test "$ac_cv_search_frexp" = "no" && for i in -lm; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_frexp="-l$i" break @@ -4755,19 +4761,19 @@ else : fi echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6 -echo "configure:4759: checking for time_t in time.h" >&5 +echo "configure:4765: checking for time_t in time.h" >&5 if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:4771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_time_h=yes else @@ -4788,19 +4794,19 @@ EOF fi echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:4792: checking for time_t in sys/types.h" >&5 +echo "configure:4798: checking for time_t in sys/types.h" >&5 if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:4804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_types_h=yes else @@ -4823,12 +4829,12 @@ fi # Under Next 3.2 apparently does not define struct utimbuf # by default. echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:4827: checking for utime.h" >&5 +echo "configure:4833: checking for utime.h" >&5 if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef HAVE_TIME_H @@ -4839,7 +4845,7 @@ int main() { struct utimbuf s; ; return 0; } EOF -if { (eval echo configure:4843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_header_utime_h=yes else @@ -4860,12 +4866,12 @@ EOF fi echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6 -echo "configure:4864: checking whether fprintf must be declared" >&5 +echo "configure:4870: checking whether fprintf must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4886,7 +4892,7 @@ int main() { char *(*pfn) = (char *(*)) fprintf ; return 0; } EOF -if { (eval echo configure:4890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_fprintf=no else @@ -4907,12 +4913,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4911: checking whether strstr must be declared" >&5 +echo "configure:4917: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4933,7 +4939,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4954,12 +4960,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:4958: checking whether sbrk must be declared" >&5 +echo "configure:4964: checking whether sbrk must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4980,7 +4986,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:4984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -5001,12 +5007,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:5005: checking whether getenv must be declared" >&5 +echo "configure:5011: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5027,7 +5033,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:5031: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -5048,12 +5054,12 @@ EOF fi echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:5052: checking whether environ must be declared" >&5 +echo "configure:5058: checking whether environ must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5074,7 +5080,7 @@ int main() { char *(*pfn) = (char *(*)) environ ; return 0; } EOF -if { (eval echo configure:5078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_environ=no else diff --git a/binutils/configure.in b/binutils/configure.in index 5e7bd3ff82..be37cecddc 100644 --- a/binutils/configure.in +++ b/binutils/configure.in @@ -44,6 +44,10 @@ CY_GNU_GETTEXT AM_MAINTAINER_MODE AC_EXEEXT +if test -n "$EXEEXT"; then + AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1, + [Does the platform use an executable suffix?]) +fi AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}", [Suffix used for executables, if any.]) diff --git a/binutils/dlltool.c b/binutils/dlltool.c index 144fd90cb4..6f8a26ca12 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -3322,7 +3322,7 @@ main (ac, av) /* Look for the program formed by concatenating PROG_NAME and the string running from PREFIX to END_PREFIX. If the concatenated string contains a '/', try appending EXECUTABLE_SUFFIX if it is - defined. */ + appropriate. */ static char * look_for_prog (prog_name, prefix, end_prefix) @@ -3335,7 +3335,7 @@ look_for_prog (prog_name, prefix, end_prefix) cmd = xmalloc (strlen (prefix) + strlen (prog_name) -#ifdef EXECUTABLE_SUFFIX +#ifdef HAVE_EXECUTABLE_SUFFIX + strlen (EXECUTABLE_SUFFIX) #endif + 10); @@ -3348,7 +3348,7 @@ look_for_prog (prog_name, prefix, end_prefix) int found; found = (stat (cmd, &s) == 0 -#ifdef EXECUTABLE_SUFFIX +#ifdef HAVE_EXECUTABLE_SUFFIX || stat (strcat (cmd, EXECUTABLE_SUFFIX), &s) == 0 #endif ); diff --git a/binutils/dllwrap.c b/binutils/dllwrap.c index 235b5dad5c..84606fb2b8 100644 --- a/binutils/dllwrap.c +++ b/binutils/dllwrap.c @@ -178,7 +178,7 @@ inform (message, va_alist) /* Look for the program formed by concatenating PROG_NAME and the string running from PREFIX to END_PREFIX. If the concatenated string contains a '/', try appending EXECUTABLE_SUFFIX if it is - defined. */ + appropriate. */ static char * look_for_prog (prog_name, prefix, end_prefix) @@ -191,7 +191,7 @@ look_for_prog (prog_name, prefix, end_prefix) cmd = xmalloc (strlen (prefix) + strlen (prog_name) -#ifdef EXECUTABLE_SUFFIX +#ifdef HAVE_EXECUTABLE_SUFFIX + strlen (EXECUTABLE_SUFFIX) #endif + 10); @@ -204,7 +204,7 @@ look_for_prog (prog_name, prefix, end_prefix) int found; found = (stat (cmd, &s) == 0 -#ifdef EXECUTABLE_SUFFIX +#ifdef HAVE_EXECUTABLE_SUFFIX || stat (strcat (cmd, EXECUTABLE_SUFFIX), &s) == 0 #endif ); diff --git a/binutils/resrc.c b/binutils/resrc.c index ed6a36a4f7..c633c2a0b1 100644 --- a/binutils/resrc.c +++ b/binutils/resrc.c @@ -146,7 +146,7 @@ look_for_default (cmd, prefix, end_prefix, preprocargs, filename) if (strchr (cmd, '/')) { found = (stat (cmd, &s) == 0 -#ifdef EXECUTABLE_SUFFIX +#ifdef HAVE_EXECUTABLE_SUFFIX || stat (strcat (cmd, EXECUTABLE_SUFFIX), &s) == 0 #endif ); @@ -207,7 +207,7 @@ read_rc_file (filename, preprocessor, preprocargs, language) + strlen (preprocessor) + strlen (preprocargs) + strlen (filename) -#ifdef EXECUTABLE_SUFFIX +#ifdef HAVE_EXECUTABLE_SUFFIX + strlen (EXECUTABLE_SUFFIX) #endif + 10); -- 2.34.1