summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/version.c13
-rwxr-xr-xsource3/script/mkversion.sh16
2 files changed, 16 insertions, 13 deletions
diff --git a/source3/lib/version.c b/source3/lib/version.c
index 3982646f56..55fb53c5db 100644
--- a/source3/lib/version.c
+++ b/source3/lib/version.c
@@ -23,16 +23,5 @@
const char *samba_version_string(void)
{
-#ifdef SAMBA_VERSION_VENDOR_FUNCTION
- return SAMBA_VERSION_VENDOR_FUNCTION;
-#else /* SAMBA_VERSION_VENDOR_FUNCTION */
- #ifdef SAMBA_VERSION_VENDOR_SUFFIX
- #ifdef SAMBA_VERSION_VENDOR_PATCH
- return SAMBA_VERSION_OFFICIAL_STRING "-" SAMBA_VERSION_VENDOR_SUFFIX \
- "-" SAMBA_VERSION_VENDOR_PATCH;
- #endif /* SAMBA_VERSION_VENDOR_PATCH */
- return SAMBA_VERSION_OFFICIAL_STRING "-" SAMBA_VERSION_VENDOR_SUFFIX;
- #endif /* SAMBA_VERSION_VENDOR_SUFFIX */
-#endif /* SAMBA_VERSION_VENDOR_FUNCTION */
- return SAMBA_VERSION_OFFICIAL_STRING;
+ return SAMBA_VERSION_STRING;
}
diff --git a/source3/script/mkversion.sh b/source3/script/mkversion.sh
index 695fc7dd9c..a55aafcd0c 100755
--- a/source3/script/mkversion.sh
+++ b/source3/script/mkversion.sh
@@ -124,7 +124,21 @@ if test -n "${SAMBA_VERSION_RELEASE_NICKNAME}";then
SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING} (${SAMBA_VERSION_RELEASE_NICKNAME})"
fi
-echo "#define SAMBA_VERSION_STRING samba_version_string()" >> $OUTPUT_FILE
+cat >>$OUTPUT_FILE<<CEOF
+#ifdef SAMBA_VERSION_VENDOR_FUNCTION
+# define SAMBA_VERSION_STRING SAMBA_VERSION_VENDOR_FUNCTION
+#else /* SAMBA_VERSION_VENDOR_FUNCTION */
+# ifdef SAMBA_VERSION_VENDOR_SUFFIX
+# ifdef SAMBA_VERSION_VENDOR_PATCH
+# define SAMBA_VERSION_STRING SAMBA_VERSION_OFFICIAL_STRING "-" SAMBA_VERSION_VENDOR_SUFFIX "-" SAMBA_VERSION_VENDOR_PATCH
+# else /* SAMBA_VERSION_VENDOR_PATCH */
+# define SAMBA_VERSION_STRING SAMBA_VERSION_OFFICIAL_STRING "-" SAMBA_VERSION_VENDOR_SUFFIX
+# endif /* SAMBA_VERSION_VENDOR_SUFFIX */
+# else /* SAMBA_VERSION_VENDOR_FUNCTION */
+# define SAMBA_VERSION_STRING SAMBA_VERSION_OFFICIAL_STRING
+# endif
+#endif
+CEOF
echo "$0: '$OUTPUT_FILE' created for Samba(\"${SAMBA_VERSION_STRING}\")"