[jhbuild] add Makefile and other tools for windows



commit 65a9bb3340a31b312598e6aafff61a082fc7791d
Author: Matthew Waters <ystreet00 gmail com>
Date:   Tue Nov 20 10:44:15 2012 +1100

    add Makefile and other tools for windows
    
    The included install-check.c file will not compile on windows without
    some work so provide a sh script that falls through to using /usr/bin/install

 Makefile.windows |   40 ++++++++++++++++++++++++++++++++++++++++
 autogen.sh       |   16 +++++++++++-----
 install-check.sh |    2 ++
 3 files changed, 53 insertions(+), 5 deletions(-)
---
diff --git a/Makefile.windows b/Makefile.windows
new file mode 100644
index 0000000..eaa4920
--- /dev/null
+++ b/Makefile.windows
@@ -0,0 +1,40 @@
+PACKAGE = jhbuild
+VERSION = 0.1
+
+CC = gcc
+CFLAGS = -Wall -O2
+
+MAKE ?= make
+
+-include Makefile.inc
+
+all: include-check
+	@echo 'Run "make install" to install.'
+
+include-check:
+	@test -f Makefile.inc || \
+	(echo "Makefile.inc doesn't exist. Please run autogen.sh"; exit 1)
+
+update:
+	git pull --rebase
+
+install: include-check
+	@echo "Creating $(bindir)/jhbuild"
+	@mkdir -p $(bindir)
+	@sed -e "s,@jhbuilddir@,`pwd -W`,g" \
+		-e "s,USE_CHECKOUT_SRC = False,USE_CHECKOUT_SRC = True," < \
+		scripts/jhbuild.in > $(bindir)/jhbuild
+	@chmod a+x $(bindir)/jhbuild
+
+	@cp install-check.sh $(bindir)/install-check
+	@chmod a+x $(bindir)/install-check
+
+#	 if ~/bin/jbuild exists, it is most likely an old version, and it will
+#	 not work; so rename it and install a symlink to the new version
+#	 instead.
+	@if [ -e "$(HOME)/bin/jhbuild" ] && [ ! $(bindir) -ef $(HOME)/bin ]; then \
+		mv "$(HOME)/bin/jhbuild" "$(HOME)/bin/jhbuild.old" ; \
+		ln -s $(bindir)/jhbuild "$(HOME)/bin/jhbuild" ; \
+	fi
+
+.PHONY: all update install
diff --git a/autogen.sh b/autogen.sh
index ff9022b..e50895b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -97,11 +97,17 @@ parse_commandline()
 }
 
 # configure JHBuild to build and install without autotools via a plain
-# Makefile. Sets up a Makefile.inc and copies Makefile.plain to Makefile
+# Makefile. Sets up a Makefile.inc and copies Makefile.plain or
+# Makefile.windows to Makefile
 configure_without_autotools()
 {
   eval_gettext "Configuring \$PKG_NAME without autotools"; echo
 
+  makefile="$srcdir/Makefile.plain"
+  if [ "x$MSYSTEM" != "x" ]; then
+    makefile="$srcdir/Makefile.windows"
+  fi
+
   # setup the defaults. The following can changed from the commandline.
   # e.g. ./autogen.sh --prefix=${HOME}/jhbuildhome
   [ -z $prefix ] && prefix=${HOME}/.local
@@ -131,13 +137,13 @@ configure_without_autotools()
   echo "datarootdir=$datarootdir" >> $srcdir/Makefile.inc
   echo "desktopdir=$desktopdir" >> $srcdir/Makefile.inc
 
-  if [ ! -f $srcdir/Makefile.plain ]; then
-    eval_gettext "Unable to read file $srcdir/Makefile.plain"; echo
+  if [ ! -f $makefile ]; then
+    eval_gettext "Unable to read file \$makefile"; echo
     exit 1
   fi
 
-  cp $srcdir/Makefile.plain $srcdir/Makefile || {
-    eval_gettext "Unable to copy \$srcdir/Makefile.plain to \$srcdir/Makefile"
+  cp $makefile $srcdir/Makefile || {
+    eval_gettext "Unable to copy \$makefile to \$srcdir/Makefile"
     echo
     exit 1
   }
diff --git a/install-check.sh b/install-check.sh
new file mode 100644
index 0000000..945a1aa
--- /dev/null
+++ b/install-check.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/install $*



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]