make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Useful patch for GNUmake on Windows


From: Earnie Boyd
Subject: RE: Useful patch for GNUmake on Windows
Date: Wed, 18 Sep 2002 08:21:54 -0400

Hello Rob, one disadvantage of using the SHELL environment variable is
that you may beusing a different interactive SHELL (requiring / setting
its own environmentvariable) than the shell you are using for make.I'm
also not so sure if the SHELL environment variable is really honored in
gmake?I think that I've read somewhere that SHELL is only accepted as a
make macro. The disadvantage of using an absolute path as SHELL make
macro is that youget things coded into the makefile that are platform
specific, while you want tohave your makefile platform independent. More
thoughts? Thanks for feedback, Martin

     -----Original Message-----
     From: Rob Tulloh [mailto:address@hidden
     Sent: Friday, September 13, 2002 04:41
     To: Martin Oberhuber; 'address@hidden'
     Subject: Re: Useful patch for GNUmake on Windows

     Isn't this already enabled through setting of SHELL? Wouldn't
     it be preferable to just define SHELL to be the full path to
     the sh.exe rather than adding another search criteria? I am
     not fully opposed to this patch, but I wonder if the current
     functionality in make is sufficient to enable this sort of
     desired behavior. It's not exactly equivalent -- you have to
     define SHELL in the environment -- but it has the same result
     of giving the user full control over what path to SHELL they
     desire.

     Thoughts?


     Rob

      Martin Oberhuber wrote:

          Hello folks,

          Paul smith suggested that I forward this mail to
          your group.

          I have created a patch for GNUmake that I believe
          might be useful
          for others as well.

          On Windows, it is often unclear what shell "make"
          uses. The default
          behavior (as of make-3.78.1) is to search for a
          program called
          "sh.exe" in the PATH; if it is found, this one is
          used, otherwise
          the Windows Commandprompt (cmd.exe) is used.

          My patch (I called it TRY_LOCAL_SHELL_FIRST) tries
          to find sh.exe
          first in the same directory where make.exe itself is
          located.

          This gives the user the freedom to define the PATH
          and add any
          shells he likes into the PATH, but still sort of
          control which
          sh.exe will be used.

          Find attached the modified files (derived from
          make-3.78.1) in
          a ZIP file as well as a diff -r -c output (patch)
          with respect
          to make-3.78.1.

          I'd be! glad if you find my patch useful and
          consider adding it
          into the default distribution.

          Thanks,
          Martin

          P.S. I'll be out of office until Wednesday, but I'll
          be glad to answer
          any questions afterwards.

          --
          
---------------------------------/()\-----------------------------------

          DI Martin Oberhuber
          mailto:address@hidden
          Senior Software Engineer Phone (UTC +1h): +43 (662)
          457915-85
          Wind River Systems (Salzburg) GmbH Fax: +43 (662)
          457915-6
          Jakob-Haringer-Str.8, A-5020 Salzburg, Austria
          http://www.windriver.com
          ----------------------- How Smart Things Think
          -------------------------


          diff -r -c make-3.78.1-localshell\config.h.W32
          ../../../unxutils/make-3.78.1\config.h.W32
          *** make-3.78.1-localshell\config.h.W32 Thu Sep 12
          16:18:02 2002
          --- ../../../unxutils/make-3.78.1\config.h.W32 Thu
          Sep 12 16:40:29 2002
          ***************
          *** 333,339 ****
          /* #undef HAVE_LIBSUN */

          /* Build host informati! on. */
          ! #define MAKE_HOST "Windows32 - default sh.exe,
          local shell first"

          /*
          * Refer to README.W32 for info on the following
          settings
          --- 333,339 ----
          /* #undef HAVE_LIBSUN */

          /* Build host information. */
          ! #define MAKE_HOST "Windows32"

          /*
          * Refer to README.W32 for info on the following
          settings
          ***************
          *** 346,359 ****
          */
          #undef BATCH_MODE_ONLY_SHELL
          #define BATCH_MODE_ONLY_SHELL 1
          -
          - /* WINDOWS32 only:
          - * First try to find the default shell sh.exe in
          the same directory
          - * where this make.exe lives. Only if the default
          shell is not found in
          - * the same directory as this make program,
          standard PATH.
          - */
          - #undef TRY_LOCAL_SHELL_FIRST
          - #define TRY_LOCAL_SHELL_FIRST 1

          /*
          * Define if you have the Cygnus "Cygwin" GNU
          Windows32 tool set.
          --- 346,351 ----
          diff -r -c make-3.78.1-localshell\main.c
          ../../../unxutils/make-3.78.1\main.c
          *** make-3.78.1-localshell\main.c Thu! Sep 12
          16:02:47 2002
          --- ../../../unxutils/make-3.78.1\main.c Thu Sep 12
          16:40:29 2002
          ***************
          *** 578,597 ****
          PATH_VAR(sh_path);
          extern char *default_shell;

          ! if (!token) {
          ! #if defined(WINDOWS32) &&
          defined(TRY_LOCAL_SHELL_FIRST)
          ! /* first try to find the default shell sh.exe in
          the same directory
          ! * where this make.exe lives. Only then search the
          standard PATH. */
          ! extern char* get_sh_in_my_dir PARAMS ((char*));
          ! search_token = get_sh_in_my_dir(default_shell);
          ! if( !search_token || !file_exists_p(search_token)
          ) {
          ! /* if it is not found in my own directory, try to
          find it in the PATH. */
          ! search_token = default_shell;
          ! }
          ! #else
          search_token = default_shell;
          - #endif
          - }
          else
          search_token = token;

          --- 578,585 ----
          PATH_VAR(sh_path);
          extern char *default_shell;

          ! if (!token)
          search_token = default_shell;
          else
          search_token = token;

          > ATTACHMEN! T part 3 application/octet-stream
          name=make-3.78.1-localshell.zip

     Rob Tulloh
     mailto:address@hidden


     --------------------------------------------------------------
     Do you Yahoo!?
     Yahoo! News - Today's headlines





reply via email to

[Prev in Thread] Current Thread [Next in Thread]