Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes for compile without git, correct how git revision hash is

generated (skip it if it's a tag or no git available or we are not
working with a checkin), also fix a bash-dependency (helps on Solaris),
and a couple of cross-platform awk fixes in configure.
  • Loading branch information...
commit 976a674b42f9647865d40fa417e7a3dc56a16e6e 1 parent 75fdcbd
Grisha Trubetskoy authored
6 configure.in
View
@@ -323,9 +323,9 @@ if test "$LEX" && test -x "$LEX"; then
AC_MSG_CHECKING(flex version)
FlexVERSION=`$LEX --version | sed 's/version//g' | awk '/flex/ {print $2}'`
- Flex_MAJOR=`echo $FlexVERSION| awk -F . '{print $1}'`
- Flex_MINOR=`echo $FlexVERSION| awk -F . '{print $2}'`
- Flex_PATCH=`echo $FlexVERSION| awk -F . '{print $3}'`
+ Flex_MAJOR=`echo $FlexVERSION| awk -F. '{print $1}'`
+ Flex_MINOR=`echo $FlexVERSION| awk -F. '{print $2}'`
+ Flex_PATCH=`echo $FlexVERSION| awk -F. '{print $3}'`
if test "$Flex_MAJOR" -eq "2" && test "$Flex_MINOR" -eq "5" && test "$Flex_PATCH" -ge "31"; then
AC_MSG_RESULT([$FlexVERSION. Good])
15 dist/version.sh
View
@@ -5,6 +5,17 @@ MPV_PATH="`dirname $0`/../src/include/mp_version.h"
MAJ=`awk '/MP_VERSION_MAJOR/ {print $3}' $MPV_PATH`
MIN=`awk '/MP_VERSION_MINOR/ {print $3}' $MPV_PATH`
PCH=`awk '/MP_VERSION_PATCH/ {print $3}' $MPV_PATH`
-GIT=`git describe --always`
-echo $MAJ.$MIN.$PCH-$GIT
+# if git exists in path
+if type git >/dev/null 2>&1; then
+ # and we are in a checkout
+ if git rev-parse 2>/dev/null; then
+ # but not on a tag (which means this is a release)
+ if test -z "`git log 'HEAD^!' --format=%d 2>/dev/null | grep 'tag: '`"; then
+ # append git revision hash to version
+ GIT="-`git describe --always`"
+ fi
+ fi
+fi
+
+echo $MAJ.$MIN.$PCH$GIT
14 src/Makefile.in
View
@@ -50,7 +50,7 @@ psp_parser.c: psp_parser.l
dso: mod_python.so
-mod_python.so: $(SRCS) @SOLARIS_HACKS@
+mod_python.so: $(SRCS) @SOLARIS_HACKS@
@echo
@echo 'Building mod_python.so.'
@echo
@@ -64,21 +64,17 @@ distclean: clean
rm -f Makefile .depend
version.c:
- @MP_GIT_SHA=$$(git describe --always); \
- echo > version.c ; \
+ @echo > version.c ; \
echo "/* THIS FILE IS AUTO-GENERATED BY Makefile */" >> version.c ; \
echo "#include \"mp_version.h\"" >> version.c ; \
- echo "const char * const mp_git_sha = \"$${MP_GIT_SHA}\";" >> version.c ; \
echo "const int mp_version_major = MP_VERSION_MAJOR;" >> version.c ; \
echo "const int mp_version_minor = MP_VERSION_MINOR;" >> version.c ; \
echo "const int mp_version_patch = MP_VERSION_PATCH;" >> version.c ; \
- echo "const char * const mp_version_string = MP_VERSION_STRING(MP_VERSION_MAJOR,MP_VERSION_MINOR,MP_VERSION_PATCH) \"-$${MP_GIT_SHA}\";" >> version.c ; \
- echo "const char * const mp_version_component = \"mod_python/\" MP_VERSION_STRING(MP_VERSION_MAJOR,MP_VERSION_MINOR,MP_VERSION_PATCH) \"-$${MP_GIT_SHA}\";" >> version.c
-
-# echo "const char * const mp_version_component = \"mod_python/\" #MP_VERSION_MAJOR \".\" #MP_VERSION_MINOR \".\" #MP_VERSION_PATCH \"-$${MP_GIT_SHA}\";" >> version.c
+ echo "const char * const mp_version_string = \"`../dist/version.sh`\";" >> version.c ; \
+ echo "const char * const mp_version_component = \"mod_python/\" \"`../dist/version.sh`\";" >> version.c
# this is a hack to help avoid a gcc/solaris problem
-# python uses assert() which needs _eprintf(). See
+# python uses assert() which needs _eprintf(). See
# SOLARIS_HACKS above
_eprintf.o:
ar -x `gcc -print-libgcc-file-name` _eprintf.o
1  src/include/mod_python.h
View
@@ -156,7 +156,6 @@ extern module AP_MODULE_DECLARE_DATA python_module;
#define MUTEX_DIR "/tmp"
/* version stuff */
-extern const char * const mp_git_sha;
extern const int mp_version_major;
extern const int mp_version_minor;
extern const int mp_version_patch;
1  src/include/mod_python.h.in
View
@@ -156,7 +156,6 @@ extern module AP_MODULE_DECLARE_DATA python_module;
#define MUTEX_DIR "@MUTEX_DIR@"
/* version stuff */
-extern const char * const mp_git_sha;
extern const int mp_version_major;
extern const int mp_version_minor;
extern const int mp_version_patch;
2  src/include/mp_version.h
View
@@ -10,5 +10,3 @@
#define MP_VERSION_MINOR 5
#define MP_VERSION_PATCH 0
-#define STR(x) #x
-#define MP_VERSION_STRING(maj, min, p) STR(maj) "." STR(min) "." STR(p)
Please sign in to comment.
Something went wrong with that request. Please try again.