patchGNU Octave - Patches: patch #7870, Allow the use of a macro,...

 
 

patch #7870: Allow the use of a macro, specifically SHELL_PATH, to provide where sh can be found.

Submitter:  Corbin Champion <corbinlc>
Submitted:  Tue 23 Oct 2012 05:17:34 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  mtmiller Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 08 Dec 2012 09:27:57 PM UTC, comment #5: 

Thanks to both of you for your patches and ideas. I have pushed a fix that is similar to Corbin's original patch but adds the configure option that I proposed:

http://hg.savannah.gnu.org/hgweb/octave/rev/ea1a1fb00744

Mike Miller <mtmiller>
Group Member
Tue 04 Dec 2012 08:50:47 PM UTC, comment #4: 

I realized we're reinventing the wheel here, please read: http://www.gnu.org/software/libc/manual/html_node/Executing-a-File.html

According to the link, the execlp() function does exactly the same job with the plus of searching the PATH for the program when no "/" is encountered in the first argument.

A nicer diff is attached.

(file #27040)

Júlio Hoffimann Mendes <juliohm>
Sat 01 Dec 2012 02:10:15 AM UTC, comment #3: 

I'm attaching a patch without macros nor preprocessor directives, i had no time to compile it though, sorry.

(file #27007)

Júlio Hoffimann Mendes <juliohm>
Thu 25 Oct 2012 09:38:48 PM UTC, comment #2: 

That does sound like the correct way to insert it into the build.  My method of CFLAGS, CPPFLAGS is not as nice.  I have not played with any of the autoconf code before other than hacking the output after it runs on occasion.  That would be interesting to learn, but I may not be able to provide quick turn around.  This patch, as is, should still be helpful, but we are not providing as nice of a method for setting SHELL_PATH.

Corbin Champion <corbinlc>
Thu 25 Oct 2012 12:51:22 AM UTC, comment #1: 

I commented on your other patch, so I figured I might as well briefly here too. How do you pass this variable in to the build? This seems like a candidate for an addition to configure, which can write it into config.h.

I did a quick search and found that git's configure script defines SHELL_PATH and has a --with-shell= option, where the default is of course /bin/sh. I'm not trying to make this harder, but adding this to configure seems like the right way to go.

Mike Miller <mtmiller>
Group Member
Tue 23 Oct 2012 05:17:34 PM UTC, original submission:  

Android does not have sh at /bin/sh, instead it is at /system/bin/sh. This allows the person building octave to use SHELL_PATH to define where sh can be found.

Corbin Champion <corbinlc>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #27040:  execlp.diff added by juliohm (1KiB - text/x-patch)
file #27007:  shell_env.patch added by juliohm (2KiB - text/x-patch)
file #26815:  shell_path.patch added by corbinlc (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by juliohm (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by corbinlc (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-12-08 mtmiller StatusNone Done
        Assigned toNone mtmiller
        Open/ClosedOpen Closed
    2012-12-04 juliohm Attached File- Added execlp.diff, #27040
    2012-12-01 juliohm Attached File- Added shell_env.patch, #27007
    2012-10-23 corbinlc Attached File- Added shell_path.patch, #26815

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code