From fb726fc55e2a79b03564be97d5057e28805d84f0 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 3 Jun 2012 16:16:31 +0000 Subject: [PATCH] Replace the svnversion mechanism with git describe. --- GNUmakefile.in | 21 ++++------------ configure | 65 +++++++++----------------------------------------- configure.ac | 3 +-- 3 files changed, 17 insertions(+), 72 deletions(-) diff --git a/GNUmakefile.in b/GNUmakefile.in index c1f81b5..471e1a2 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -60,17 +60,12 @@ CY_OBJECTIVEC := @CY_OBJECTIVEC@ CY_OBJECTIVEC_MACH := @CY_OBJECTIVEC_MACH@ CY_ATTACH_GROUP := @CY_ATTACH_GROUP@ -svn := @SVN@ -svnversion := @SVNVERSION@ +git := @GIT@ -ifneq ($(svnversion),) -release := $(shell svnversion $(srcdir)) - -ifneq ($(release),exported) -gnutar := @GNUTAR@ -version := @PACKAGE_VERSION@.$(release) -tarname := @PACKAGE_TARNAME@-$(version) -endif +ifneq ($(git),) +version := $(shell $(git) describe --always --tags --dirty="+" --match="v*" | $(sed) -e 's@-\([^-]*\)-\([^-]*\)$$@+\1.\2@;s@^v@@') +else +version := @PACKAGE_VERSION@ endif paths := $(foreach path,$(paths),$(wildcard $(path))) @@ -243,12 +238,6 @@ test: cycript if [[ -e jquery.js ]]; then $(time) ./cycript -c jquery.js >jquery.cyc.js; gzip -9c jquery.cyc.js >jquery.cyc.js.gz; wc -c jquery.{mam,gcc,cyc,bak,yui}.js; wc -c jquery.{cyc,gcc,bak,mam,yui}.js.gz; fi if [[ -e test.cy ]]; then ./cycript test.cy; fi -ifneq ($(gnutar),:) -dist: - echo -n >> $(tarname).tar.gz - $(gnutar) -cC $(srcdir) -f $(tarname).tar.gz -vX <($(svn) propget svn:ignore $(srcdir)) -z --exclude-vcs --show-transformed-names --transform='s#^\.#$(tarname)#' . -endif - install: cycript libcycript.la $(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(libtool) --mode=install $(INSTALL_PROGRAM) libcycript.la $(DESTDIR)$(libdir)/libcycript.la diff --git a/configure b/configure index c0cfd24..de73b08 100755 --- a/configure +++ b/configure @@ -640,8 +640,7 @@ CXXCPP ac_ct_CXX CXXFLAGS CXX -SVNVERSION -SVN +GIT GNUTAR INSTALL_DATA INSTALL_SCRIPT @@ -11419,17 +11418,17 @@ else $as_echo "no" >&6; } fi -for ac_prog in svn +for ac_prog in git do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_SVN+:} false; then : +if ${ac_cv_prog_GIT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$SVN"; then - ac_cv_prog_SVN="$SVN" # Let the user override the test. + if test -n "$GIT"; then + ac_cv_prog_GIT="$GIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -11438,7 +11437,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_SVN="$ac_prog" + ac_cv_prog_GIT="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -11448,59 +11447,17 @@ IFS=$as_save_IFS fi fi -SVN=$ac_cv_prog_SVN -if test -n "$SVN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SVN" >&5 -$as_echo "$SVN" >&6; } +GIT=$ac_cv_prog_GIT +if test -n "$GIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 +$as_echo "$GIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$SVN" && break -done - -for ac_prog in svnversion -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_SVNVERSION+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$SVNVERSION"; then - ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_SVNVERSION="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -SVNVERSION=$ac_cv_prog_SVNVERSION -if test -n "$SVNVERSION"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SVNVERSION" >&5 -$as_echo "$SVNVERSION" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$SVNVERSION" && break + test -n "$GIT" && break done ac_ext=cpp diff --git a/configure.ac b/configure.ac index 6cf476e..3900105 100644 --- a/configure.ac +++ b/configure.ac @@ -53,8 +53,7 @@ AS_IF([test "x$ac_cv_path_GNUTAR" != x], [ AC_SUBST([GNUTAR], [:]) AC_MSG_RESULT([no]) ]) -AC_CHECK_PROGS([SVN], [svn]) -AC_CHECK_PROGS([SVNVERSION], [svnversion]) +AC_CHECK_PROGS([GIT], [git]) AC_PROG_CXX AC_PROG_OBJCXX AC_LANG([C++]) -- 2.45.2