On Mar 11, 2009, at 12:10 PM, Glynn Clements wrote:


The way that we normally make shell scripts work on Windows is to
provide a .bat file which explicitly invokes the script via $GRASS_SH.

On Windows, the $GISBASE/bin directory will contain a .bat file for
each script in the $GISBASE/scripts directory. These are created using
the scripts/windows_launch.bat file as a template.

It may suffice to add $GISBASE/etc/gui/scripts/v.type.sh.bat. If that
doesn't work, add an "if windows ..." case to gis.m's "execute"
function, which invokes the script via $env(GRASS_SH).

-- Glynn Clements <gl...@gclements.plus.com>

This sounds good. Two questions.

1) How can we get the *.bat files to be generated for files in the
$GISBASE/ext/gui/scripts folder?

For the scripts in the scripts directory, this is done via the
following rule from Script.make:

$(BIN)/$(PGM).bat: $(MODULE_TOPDIR)/scripts/windows_launch.bat
sed -e "s#SCRIPT_NAME#$(PGM)#" $(MODULE_TOPDIR)/scripts/ windows_launch.bat > $@

For the gui/scripts, the above rule can be generalised to a pattern rule:

$(GISBASE)/etc/gui/scripts/%.bat: $(MODULE_TOPDIR)/scripts/ windows_launch.bat sed -e "s#SCRIPT_NAME#$*#" $(MODULE_TOPDIR)/scripts/ windows_launch.bat > $@

You then need to "make" the relevant .bat files with e.g.:

for file in *.* ; do $(MAKE) $(GISBASE)/etc/gui/scripts/$ $file.bat ; done

2) Can v.type.sh.bat be called by just specifying v.type.sh? Or do you
need to fully specify the *.bat extension?

Just using the base name seems to work for everything else, although I
can't exclude the possibility that Tcl behaves differently depending
upon whether a full path is used (it's actually Tcl which tries the
.exe and .bat suffixes; it doesn't use Windows' ShellExecute()).

--
Glynn Clements <gl...@gclements.plus.com>

If someone who knows the build system well can make the changes Glynn recommended to Script.make, we can test to see if that does the trick. If not, I can change try to conditionalize the TclTk call for windows to find v.type.sh.bat.

(related question, is such a name permitted for Windows XP and Vista?)

Michael



_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to