Author Topic: MSYS build  (Read 9855 times)

spowers

  • Community Member
  • Posts: 46
  • Hero Points: 0
MSYS build
« on: November 20, 2007, 08:48:31 PM »
I'm trying to import an API that uses msys and minGW to build.

Is there a way to script this build process into slickEdit???

The current build process is the following:

untar source to "C:\msys\1.0\" or a sub-directory of this. Then, from within the MSYS tool either run:

./configure
make
make install

or use the older makefiles :

export PLAT=mingw32
make PLAT=mingw32


-------------------------------------
The part that is tripping me up is the configure. If I use the "older" makefiles it starts looking for msys specific commands.

Specifically:
/bin/sh ./config.status --recheck
./config.status: ./config.status: No such file or directory






spowers

  • Community Member
  • Posts: 46
  • Hero Points: 0
Re: MSYS build
« Reply #1 on: November 21, 2007, 02:31:54 PM »
no one has ever had to compile things like this with slick edit???

hs2

  • Senior Community Member
  • Posts: 2762
  • Hero Points: 292
Re: MSYS build
« Reply #2 on: November 21, 2007, 02:41:37 PM »
Although I'm not sure what you want to do/what the problem is you could use any shell script as build tool or you could add the magic untar as pre-build command, or ...
It's all setup in the Project>Project propoerties.
Hope it helps,
HS2

spowers

  • Community Member
  • Posts: 46
  • Hero Points: 0
Re: MSYS build
« Reply #3 on: November 21, 2007, 07:17:53 PM »
I think the problem is ./configure can only be done within the msys shell. I'm not sure how to run a msys shell from slick edit.

hs2

  • Senior Community Member
  • Posts: 2762
  • Hero Points: 292
Re: MSYS build
« Reply #4 on: November 21, 2007, 09:21:24 PM »
Google told me that the mysterious 'msys shell' is a bash derivate. That's cool b/c it normally supports commandline args which could be used to launch configure and friends. I'm using sth. similar with a cygwin (nash) based environment.
Have a look at http://community.slickedit.com/index.php?topic=2330.msg9711#msg9711
You should be able to do that with the msys shell.
Example:
Code: [Select]
msysshell.cmd "cd <somewhere>; configure; make; make install"
Good luck,
HS2

thefrogger

  • Community Member
  • Posts: 38
  • Hero Points: 2
Re: MSYS build
« Reply #5 on: November 22, 2007, 04:52:53 AM »
I've been wanting to do something similar, and the problem has been that getting msys to perform an on-launch command does not appear to be part of its standard behavior. But it looks like I've found the parts needed to get this working.

Here's the page I found that describes adding the ability to run a command on msys launch:
http://osdir.com/ml/gnu.mingw.announce/2006-04/msg00023.html

The solution is around the middle of the page, and involves adding a bunch of lines to the msys.bat file, and appending "%COMMAND%" at the end of the line that begins with "start rxvt". Once that's done, you can issue a command for msys to execute when launching the shell. Such as, "msys make".

The thing is, their solution didn't allow me to pass multiple msys commands through the interface. (The accompanying text makes it look like it should handle it, but it didn't work for me). In any case, it led to another option that's a bit simpler if all you want to do is batch msys operations from SE. And multiple commands work fine here.

Make a copy of the original msys.bat, and rename it to something appropriate for the actual task you want to perform.
Find the line that begins with "start rxvt...".
Append the commands you want to execute directly into batch file, at the end of this line. Add "-c", and put your commands in double quotes thereafter. Separate multiple commands with ';'. If you want the shell window to stay open, append ";sh" to that. Without it, the commands will execute and the shell will close.

The line will look something like this:

start rxvt -backspacekey -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-12 -tn msys -geometry 80x25 -e /bin/sh --login -i -c "./configure;make;make install;sh"

Now if you edit your project properties, and change the build command line to the batch file that you created, it will build automatically from within SlickEdit. Depending upon your path settings, you may have trouble running the batch and/or msys finding its rxvt.exe component. What I did, was save my batch file in msys's directory, and tell SE to "Run from dir" from there.

The only remaining problem, is that while SE launches and complete the msys build process successfully now, it does not capture the output thereof. So I'm still not getting the benefits of linking build errors back to source code lines, and if anyone else can suggest a possible means to get past that one, I'd have a complete solution.

« Last Edit: November 22, 2007, 04:54:37 AM by thefrogger »

spowers

  • Community Member
  • Posts: 46
  • Hero Points: 0
Re: MSYS build
« Reply #6 on: November 26, 2007, 03:59:48 PM »
I got this to the point where it will run a bash command from SE.

The problem I'm having now is directing it towards the ./configure command.

the configure file is not located under the msys directory so I'm not sure how to navigate to it through the bash shell


Any ideas?

thefrogger

  • Community Member
  • Posts: 38
  • Hero Points: 2
Re: MSYS build
« Reply #7 on: November 26, 2007, 04:28:05 PM »
You should be able to "cd" there, even if it means a few rounds of "../" to back out of the msys directory.

But if that doesn't work for some reason, you can set the HOME environment variable to point to the starting dir of your choice. And if you're using a dedicated batch file to launch msys, you can do that right in the batch. Use the unix-style path format for this, such as:

set HOME=/d/projects/test

--
John