From a1241e68b181ab345a5761bf85f9491700e92d3c Mon Sep 17 00:00:00 2001
From: Zooko O'Whielacronx <zooko@zooko.com>
Date: Thu, 26 Apr 2007 17:49:01 -0700
Subject: [PATCH] GNUmakefile: detect trial's location better on Windows

---
 GNUmakefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 8207c021..ac197fee 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -6,7 +6,13 @@ INSTDIR=$(BASE)/instdir
 PATHSEP=$(shell python -c 'import os ; print os.pathsep')
 TRIALPATH=$(shell which trial.py 2>/dev/null)
 ifeq ($(TRIALPATH),)
-TRIALPATH=$(shell which trial)
+TRIALPATH=$(shell which trial 2>/dev/null)
+endif
+ifeq ($(TRIALPATH),)
+TRIALPATH=$(shell $(PYTHON) -c "import os, sys; print repr(os.path.join(sys.prefix, \"Scripts\", \"trial.py\"))")
+endif
+ifeq ($(TRIALPATH),)
+TRIALPATH=$(shell $(PYTHON) -c "import os, sys; print repr(os.path.join(sys.prefix, \"Scripts\", \"trial\"))")
 endif
 
 EXTRA_SETUP_ARGS=
@@ -36,7 +42,6 @@ PYTHONPATH := "$(INSTDIR)"
 endif
 
 TRIAL=$(PYTHON) -u "$(TRIALPATH)" --reactor=$(REACTOR)
-# $(error $(TRIAL))
 
 show-instdir:
 	@echo $(INSTDIR)
-- 
2.45.2