Comments (3)
Could you try this patch? It should make everything work with or without git (it also fixes the other Solaris issues). I'd like to make sure it works for you before I commit it. Thanks!
diff --git a/configure.in b/configure.in
index 64f13d8..a669c87 100644
--- a/configure.in
+++ b/configure.in
@@ -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])
diff --git a/dist/version.sh b/dist/version.sh
index 1060b4f..e50000d 100755
--- a/dist/version.sh
+++ b/dist/version.sh
@@ -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
diff --git a/src/Makefile.in b/src/Makefile.in
index c3b3fb2..081c954 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -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
diff --git a/src/include/mod_python.h b/src/include/mod_python.h
index 061146b..68a77d4 100644
--- a/src/include/mod_python.h
+++ b/src/include/mod_python.h
@@ -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;
diff --git a/src/include/mod_python.h.in b/src/include/mod_python.h.in
index 4b6f1fb..7d536c5 100644
--- a/src/include/mod_python.h.in
+++ b/src/include/mod_python.h.in
@@ -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;
diff --git a/src/include/mp_version.h b/src/include/mp_version.h
index 4b3a494..5ed83a1 100644
--- a/src/include/mp_version.h
+++ b/src/include/mp_version.h
@@ -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)
from mod_python.
Resolved in 976a674
from mod_python.
It would be nice to have this fix in a released version.
from mod_python.
Related Issues (20)
- segfault when releasing a thread HOT 16
- Prefer checking .so over the Python version HOT 3
- Linux packages HOT 2
- Tests failing on Red Hat Linux HOT 1
- configure - flex version test needs to be modified.
- Fatal Python error: PyEval_RestoreThread: NULL tstate HOT 2
- Python 3.10 detected as 3.1 HOT 1
- Still live? HOT 3
- Segfault when porting to python 3.10 HOT 2
- detect python version failed HOT 2
- parse_qsl problems HOT 1
- How to configure the Python interpreter path? HOT 4
- UTF-8 characters in page sources no longer supported under Python 3 HOT 1
- Mod Python causing segmentation faults when compiled with Python3.9 HOT 2
- Segfaults when compiled against python 3.11 HOT 1
- Not able to compile mod_python with Python3.11
- Please do a new release for Python 3.11 compat HOT 9
- Python 3.12 failed because imp was removed. HOT 14
- ImportError: Import by filename is not supported.
- Website link outdated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mod_python.