summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile.sub24
-rwxr-xr-xwin32/configure.bat14
2 files changed, 36 insertions, 2 deletions
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index ffccd1422c..8bf9077484 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -393,14 +393,34 @@ top_srcdir = $(srcdir)
hdrdir = $(srcdir)/include
VPATH = $(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/missing;$(win_srcdir)
+!ifndef GIT
+GIT = git
+!endif
+!if "$(HAVE_GIT)" == "yes" || "$(HAVE_GIT)" == "no"
+!else if "$(GIT)" == ""
+HAVE_GIT = no
+!else if [for %I in ($(GIT)) @if not "%~xI" == "" exit 1]
+! if [for %I in ($(GIT)) @if not "%~$PATH:I" == "" exit 1]
+HAVE_GIT = yes
+! else
+HAVE_GIT = no
+! endif
+!else
+! if [for %x in (%PATHEXT:;= %) do @for %I in ($(GIT)%x) do @if not "%~$PATH:I" == . exit 1]
+HAVE_GIT = yes
+! else
+HAVE_GIT = no
+! endif
+!endif
+
!if exist($(srcdir)/.svn)
VCS = svn
VCSUP = $(VCS) up $(SVNUPOPTIONS)
!else if exist($(srcdir)/.git/svn)
-VCS = git svn
+VCS = $(GIT) svn
VCSUP = $(VCS) rebase $(GITSVNREBASEOPTIONS)
!else if exist($(srcdir)/.git)
-VCS = git
+VCS = $(GIT)
VCSUP = $(VCS) pull $(GITPULLOPTIONS)
!else
VCSUP = rem
diff --git a/win32/configure.bat b/win32/configure.bat
index dca517e4f4..18c9d95963 100755
--- a/win32/configure.bat
+++ b/win32/configure.bat
@@ -41,6 +41,8 @@ if "%1" == "--path" goto :path
if "%1" == "--with-baseruby" goto :baseruby
if "%1" == "--with-ntver" goto :ntver
if "%1" == "--with-libdir" goto :libdir
+if "%1" == "--with-git" goto :git
+if "%1" == "--without-git" goto :nogit
if "%1" == "--without-ext" goto :witharg
if "%1" == "--without-extensions" goto :witharg
if "%opt:~0,10%" == "--without-" goto :withoutarg
@@ -179,6 +181,18 @@ goto :loop ;
shift
shift
goto :loop ;
+:git
+ echo>> ~tmp~.mak "GIT=%~2" \
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop ;
+:nogit
+ echo>> ~tmp~.mak "GIT=never-use" \
+ echo>> ~tmp~.mak "HAVE_GIT=no" \
+ echo>>confargs.tmp %1 \
+ shift
+goto :loop ;
:witharg
echo>>confargs.tmp %1=%2\
set witharg=1