summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-01-28 12:47:52 +0000
committerStefan Metzmacher <metze@samba.org>2004-01-28 12:47:52 +0000
commite06687eb174d5ca785a6c67fa63a99ea019182c4 (patch)
tree31820abce3978d9b1b6ea5120dbeb22dab7184d0
parent2ffa2fe1654d3f3d7f0ba17d73c3f8db5710b38e (diff)
downloadsamba-e06687eb174d5ca785a6c67fa63a99ea019182c4.tar.gz
samba-e06687eb174d5ca785a6c67fa63a99ea019182c4.tar.bz2
samba-e06687eb174d5ca785a6c67fa63a99ea019182c4.zip
merge the version.h autogeneration stuff from 3.0
metze (This used to be commit 24dc237e109f6dce69814b22e0fb7878a7f6bfa8)
-rw-r--r--source4/.cvsignore2
-rw-r--r--source4/Makefile.in19
-rw-r--r--source4/VERSION123
-rwxr-xr-xsource4/autogen.sh5
-rw-r--r--source4/client/client.c2
-rw-r--r--source4/include/.cvsignore1
-rw-r--r--source4/lib/cmdline/popt_common.c2
-rw-r--r--source4/lib/fault.c2
-rw-r--r--source4/lib/popt_common.c2
-rw-r--r--source4/lib/version.c42
-rw-r--r--source4/param/loadparm.c2
-rwxr-xr-xsource4/script/mkversion.sh87
-rw-r--r--source4/smbd/process_thread.c4
-rw-r--r--source4/smbd/server.c2
-rw-r--r--source4/smbd/sesssetup.c2
15 files changed, 285 insertions, 12 deletions
diff --git a/source4/.cvsignore b/source4/.cvsignore
index d1c78732c9..be9c9299c3 100644
--- a/source4/.cvsignore
+++ b/source4/.cvsignore
@@ -7,7 +7,7 @@ libsmb
.proto.check
.proto.stamp
autom4te.cache
-ID
+autom4te-2.53.cache
ID
Makefile
bin
diff --git a/source4/Makefile.in b/source4/Makefile.in
index 0b64218c20..4baa3f1078 100644
--- a/source4/Makefile.in
+++ b/source4/Makefile.in
@@ -99,7 +99,7 @@ MODULES = $(CHARSET_MODULES) $(DCERPC_MODULES) $(NTVFS_MODULES)
TDBBASE_OBJ = tdb/tdb.o tdb/spinlock.o
TDB_OBJ = $(TDBBASE_OBJ) tdb/tdbutil.o
-LIB_OBJ = lib/charcnv.o lib/debug.o lib/fault.o \
+LIB_OBJ = lib/version.o lib/charcnv.o lib/debug.o lib/fault.o \
lib/getsmbpass.o lib/interface.o lib/md4.o \
lib/interfaces.o lib/pidfile.o lib/replace.o \
lib/signal.o lib/system.o lib/sendfile.o lib/time.o \
@@ -377,6 +377,18 @@ dynconfig.po: dynconfig.c Makefile
@BROKEN_CC@ -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.po$$%.o%'` $@
@POBAD_CC@ @mv $*.po.o $@
+lib/version.o: lib/version.c include/version.h
+ @echo Compiling $*.c
+ @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) -c $< -o $@
+
+lib/version.po: lib/version.c include/version.h
+ @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
+ dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
+ @echo Compiling $*.c with @PICFLAG@
+ @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAG@ -c $< -o $*.@PICSUFFIX@
+@BROKEN_CC@ -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.po$$%.o%'` $@
+@POBAD_CC@ @mv $*.po.o $@
+
.c.po:
@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
@@ -538,6 +550,11 @@ distclean: realclean
-rm -f config.status config.cache so_locations
-rm -rf .deps
+realdistclean: distclean
+ -rm -f include/config.h.in
+ -rm -f lib/version.h
+ -rm -f configure
+
# when configure.in is updated, reconfigure
$(srcdir)/configure: $(srcdir)/configure.in
@echo "WARNING: you need to rerun ./autogen.sh"
diff --git a/source4/VERSION b/source4/VERSION
new file mode 100644
index 0000000000..91c1f98b38
--- /dev/null
+++ b/source4/VERSION
@@ -0,0 +1,123 @@
+########################################################
+# SAMBA Version #
+# #
+# script/mkversion.sh #
+# will use this file to create #
+# include/version.h #
+# #
+########################################################
+
+########################################################
+# This are the main SAMBA version numbers #
+# #
+# <MAJOR>.<MINOR>.<RELEASE> #
+# #
+# e.g. SAMBA_VERSION_MAJOR=3 #
+# SAMBA_VERSION_MINOR=0 #
+# SAMBA_VERSION_RELEASE=0 #
+# -> "3.0.0" #
+########################################################
+SAMBA_VERSION_MAJOR=4
+SAMBA_VERSION_MINOR=0
+SAMBA_VERSION_RELEASE=0
+
+########################################################
+# If a official release has a serious bug #
+# a security release will have 'a' sufffix #
+# #
+# so SAMBA's version will be #
+# <MAJOR>.<MINOR>.<RELEASE><REVISION> #
+# #
+# e.g. SAMBA_VERSION_PRE_RELEASE=a #
+# -> "2.2.8a" #
+########################################################
+SAMBA_VERSION_REVISION=
+
+########################################################
+# For 'pre' releases the version will be #
+# #
+# <MAJOR>.<MINOR>.<RELEASE>pre<PRE_RELEASE> #
+# #
+# e.g. SAMBA_VERSION_PRE_RELEASE=1 #
+# -> "2.2.9pre1" #
+########################################################
+SAMBA_VERSION_PRE_RELEASE=
+
+########################################################
+# For 'rc' releases the version will be #
+# #
+# <MAJOR>.<MINOR>.<RELEASE>rc<RC_RELEASE> #
+# #
+# e.g. SAMBA_VERSION_RC_RELEASE=1 #
+# -> "3.0.0rc1" #
+########################################################
+SAMBA_VERSION_RC_RELEASE=
+
+########################################################
+# For 'beta' releases the version will be #
+# #
+# <MAJOR>.<MINOR>.<RELEASE>beta<BETA_RELEASE> #
+# #
+# e.g. SAMBA_VERSION_BETA_RELEASE=3 #
+# -> "3.0.0beta3" #
+########################################################
+SAMBA_VERSION_BETA_RELEASE=
+
+########################################################
+# For 'alpha' releases the version will be #
+# #
+# <MAJOR>.<MINOR>.<RELEASE>alpha<ALPHA_RELEASE> #
+# #
+# e.g. SAMBA_VERSION_ALPHA_RELEASE=1 #
+# -> "4.0.0alpha1" #
+########################################################
+SAMBA_VERSION_ALPHA_RELEASE=
+
+########################################################
+# For 'test' releases the version will be #
+# #
+# <MAJOR>.<MINOR>.<RELEASE>test<TEST_RELEASE> #
+# #
+# e.g. SAMBA_VERSION_TEST_RELEASE=1 #
+# -> "4.0.0test1" #
+########################################################
+SAMBA_VERSION_TEST_RELEASE=1
+
+########################################################
+# To mark CVS snapshots this should be set to 'yes' #
+# in the development BRANCH, and set to 'no' only in #
+# the SAMBA_X_X_RELEASE BRANCH #
+# #
+# <MAJOR>.<MINOR>.<RELEASE>[...]cvs #
+# #
+# e.g. SAMBA_VERSION_IS_CVS_SNAPSHOT=yes #
+# -> "CVS 3.0.0rc2" #
+########################################################
+SAMBA_VERSION_IS_CVS_SNAPSHOT=yes
+
+########################################################
+# This can be set by vendors if they want... #
+# This can be a string constant or a function which #
+# returns a string (const char *) #
+# #
+# <MAJOR>.<MINOR>.<RELEASE>[...]-<VENDOR_SUFFIX> #
+# #
+# Note the '-' is automaticaly added #
+# #
+# e.g. SAMBA_VERSION_VENDOR_SUFFIX="VendorVersion" #
+# -> "CVS 3.0.0rc2-VendorVersion" #
+# #
+# Note: If you want to use a function, #
+# then patch lib/version.c and add this function #
+# there, because the symbol must be available in #
+# binary. #
+# #
+# const char *vendor_version(void) #
+# { #
+# return "VendorVersion"; #
+# } #
+# #
+# e.g. SAMBA_VERSION_VENDOR_SUFFIX=vendor_version() #
+# -> "CVS 3.0.0rc2-VendorVersion" #
+########################################################
+SAMBA_VERSION_VENDOR_SUFFIX=
diff --git a/source4/autogen.sh b/source4/autogen.sh
index 4b879d06ef..aa8534858e 100755
--- a/source4/autogen.sh
+++ b/source4/autogen.sh
@@ -47,7 +47,8 @@ if [ "$AUTOCONFFOUND" = "0" -o "$AUTOHEADERFOUND" = "0" ]; then
exit 1
fi
-
+echo "$0: running script/mkversion.sh"
+./script/mkversion.sh || exit 1
echo "$0: running $AUTOHEADER"
$AUTOHEADER || exit 1
@@ -55,6 +56,8 @@ $AUTOHEADER || exit 1
echo "$0: running $AUTOCONF"
$AUTOCONF || exit 1
+rm -rf autom4te.cache autom4te-2.53.cache
+
echo "Now run ./configure and then make."
exit 0
diff --git a/source4/client/client.c b/source4/client/client.c
index 7cf3a0b125..4fbafa9439 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -3046,7 +3046,7 @@ static void remember_query_host(const char *arg,
use_kerberos = cmdline_auth_info.use_kerberos;
got_pass = cmdline_auth_info.got_pass;
- DEBUG( 3, ( "Client started (version %s).\n", SAMBA_VERSION ) );
+ DEBUG( 3, ( "Client started (version %s).\n", SAMBA_VERSION_STRING ) );
talloc_destroy(mem_ctx);
if (tar_type) {
diff --git a/source4/include/.cvsignore b/source4/include/.cvsignore
index f486ccaba1..f27200350c 100644
--- a/source4/include/.cvsignore
+++ b/source4/include/.cvsignore
@@ -6,3 +6,4 @@ proto.h
stamp-h
tdbsam2_parse_info.h
wrepld_proto.h
+version.h
diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c
index 3c9a5eb231..1b8e3bd93e 100644
--- a/source4/lib/cmdline/popt_common.c
+++ b/source4/lib/cmdline/popt_common.c
@@ -66,7 +66,7 @@ static void popt_common_callback(poptContext con,
break;
case 'V':
- printf( "Version %s\n", SAMBA_VERSION );
+ printf( "Version %s\n", SAMBA_VERSION_STRING );
exit(0);
break;
diff --git a/source4/lib/fault.c b/source4/lib/fault.c
index 5a76ce2c0c..47a43bca84 100644
--- a/source4/lib/fault.c
+++ b/source4/lib/fault.c
@@ -39,7 +39,7 @@ static void fault_report(int sig)
if (counter) _exit(1);
DEBUG(0,("===============================================================\n"));
- DEBUG(0,("INTERNAL ERROR: Signal %d in pid %d (%s)",sig,(int)getpid(),SAMBA_VERSION));
+ DEBUG(0,("INTERNAL ERROR: Signal %d in pid %d (%s)",sig,(int)getpid(),SAMBA_VERSION_STRING));
DEBUG(0,("\nPlease read the file BUGS.txt in the distribution\n"));
DEBUG(0,("===============================================================\n"));
diff --git a/source4/lib/popt_common.c b/source4/lib/popt_common.c
index 3c9a5eb231..1b8e3bd93e 100644
--- a/source4/lib/popt_common.c
+++ b/source4/lib/popt_common.c
@@ -66,7 +66,7 @@ static void popt_common_callback(poptContext con,
break;
case 'V':
- printf( "Version %s\n", SAMBA_VERSION );
+ printf( "Version %s\n", SAMBA_VERSION_STRING );
exit(0);
break;
diff --git a/source4/lib/version.c b/source4/lib/version.c
new file mode 100644
index 0000000000..99f836c2d5
--- /dev/null
+++ b/source4/lib/version.c
@@ -0,0 +1,42 @@
+/*
+ Unix SMB/CIFS implementation.
+ Samba Version functions
+
+ Copyright (C) Stefan Metzmacher 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+
+const char *samba_version_string(void)
+{
+#ifndef SAMBA_VERSION_VENDOR_SUFFIX
+ return SAMBA_VERSION_OFFICIAL_STRING;
+#else
+ static fstring samba_version;
+ static BOOL init_samba_version;
+
+ if (init_samba_version)
+ return samba_version;
+
+ snprintf(samba_version,sizeof(samba_version),"%s-%s",
+ SAMBA_VERSION_OFFICIAL_STRING,
+ SAMBA_VERSION_VENDOR_SUFFIX);
+
+ init_samba_version = True;
+ return samba_version;
+#endif
+}
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 9052fe4409..41470cf3f1 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -1300,7 +1300,7 @@ static void init_globals(void)
string_set(&Globals.szLockDir, dyn_LOCKDIR);
string_set(&Globals.szSocketAddress, "0.0.0.0");
pstrcpy(s, "Samba ");
- pstrcat(s, SAMBA_VERSION);
+ pstrcat(s, SAMBA_VERSION_STRING);
string_set(&Globals.szServerString, s);
slprintf(s, sizeof(s) - 1, "%d.%d", DEFAULT_MAJOR_VERSION,
DEFAULT_MINOR_VERSION);
diff --git a/source4/script/mkversion.sh b/source4/script/mkversion.sh
new file mode 100755
index 0000000000..ca39297940
--- /dev/null
+++ b/source4/script/mkversion.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+
+VERSION_FILE=$1
+OUTPUT_FILE=$2
+
+if test -z "$VERSION_FILE";then
+ VERSION_FILE="VERSION"
+fi
+
+if test -z "$OUTPUT_FILE";then
+ OUTPUT_FILE="include/version.h"
+fi
+
+SOURCE_DIR=$3
+
+SAMBA_VERSION_MAJOR=`sed -n 's/^SAMBA_VERSION_MAJOR=//p' $SOURCE_DIR$VERSION_FILE`
+SAMBA_VERSION_MINOR=`sed -n 's/^SAMBA_VERSION_MINOR=//p' $SOURCE_DIR$VERSION_FILE`
+SAMBA_VERSION_RELEASE=`sed -n 's/^SAMBA_VERSION_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_REVISION=`sed -n 's/^SAMBA_VERSION_REVISION=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_PRE_RELEASE=`sed -n 's/^SAMBA_VERSION_PRE_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_RC_RELEASE=`sed -n 's/^SAMBA_VERSION_RC_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_BETA_RELEASE=`sed -n 's/^SAMBA_VERSION_BETA_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_ALPHA_RELEASE=`sed -n 's/^SAMBA_VERSION_ALPHA_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_TEST_RELEASE=`sed -n 's/^SAMBA_VERSION_TEST_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_IS_CVS_SNAPSHOT=`sed -n 's/^SAMBA_VERSION_IS_CVS_SNAPSHOT=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_VENDOR_SUFFIX=`sed -n 's/^SAMBA_VERSION_VENDOR_SUFFIX=//p' $SOURCE_DIR$VERSION_FILE`
+
+echo "/* Autogenerated by script/mkversion.sh */" > $OUTPUT_FILE
+
+echo "#define SAMBA_VERSION_MAJOR ${SAMBA_VERSION_MAJOR}" >> $OUTPUT_FILE
+echo "#define SAMBA_VERSION_MINOR ${SAMBA_VERSION_MINOR}" >> $OUTPUT_FILE
+echo "#define SAMBA_VERSION_RELEASE ${SAMBA_VERSION_RELEASE}" >> $OUTPUT_FILE
+
+
+SAMBA_VERSION_STRING="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${SAMBA_VERSION_RELEASE}"
+
+
+if test -n "${SAMBA_VERSION_REVISION}";then
+ SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}${SAMBA_VERSION_REVISION}"
+ echo "#define SAMBA_VERSION_REVISION \"${SAMBA_VERSION_REVISION}\"" >> $OUTPUT_FILE
+elif test -n "${SAMBA_VERSION_PRE_RELEASE}";then
+ SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}pre${SAMBA_VERSION_PRE_RELEASE}"
+ echo "#define SAMBA_VERSION_PRE_RELEASE ${SAMBA_VERSION_PRE_RELEASE}" >> $OUTPUT_FILE
+elif test -n "${SAMBA_VERSION_RC_RELEASE}";then
+ SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}rc${SAMBA_VERSION_RC_RELEASE}"
+ echo "#define SAMBA_VERSION_RC_RELEASE ${SAMBA_VERSION_RC_RELEASE}" >> $OUTPUT_FILE
+elif test -n "${SAMBA_VERSION_BETA_RELEASE}";then
+ SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}beta${SAMBA_VERSION_BETA_RELEASE}"
+ echo "#define SAMBA_VERSION_BETA_RELEASE ${SAMBA_VERSION_BETA_RELEASE}" >> $OUTPUT_FILE
+elif test -n "${SAMBA_VERSION_ALPHA_RELEASE}";then
+ SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}alpha${SAMBA_VERSION_ALPHA_RELEASE}"
+ echo "#define SAMBA_VERSION_ALPHA_RELEASE ${SAMBA_VERSION_ALPHA_RELEASE}" >> $OUTPUT_FILE
+elif test -n "${SAMBA_VERSION_TEST_RELEASE}";then
+ SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}test${SAMBA_VERSION_TEST_RELEASE}"
+ echo "#define SAMBA_VERSION_TEST_RELEASE ${SAMBA_VERSION_TEST_RELEASE}" >> $OUTPUT_FILE
+fi
+
+
+if test x"${SAMBA_VERSION_IS_CVS_SNAPSHOT}" = x"yes";then
+ SAMBA_VERSION_STRING="CVS ${SAMBA_VERSION_STRING}"
+ echo "#define SAMBA_VERSION_IS_CVS_SNAPSHOT 1" >> $OUTPUT_FILE
+fi
+
+if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
+ echo "#define SAMBA_VERSION_VENDOR_SUFFIX ${SAMBA_VERSION_VENDOR_SUFFIX}" >> $OUTPUT_FILE
+fi
+
+echo "#define SAMBA_VERSION_OFFICIAL_STRING \"${SAMBA_VERSION_STRING}\"" >> $OUTPUT_FILE
+
+echo "#define SAMBA_VERSION_STRING samba_version_string()" >> $OUTPUT_FILE
+
+echo "$0: 'include/version.h' created for Samba(\"${SAMBA_VERSION_STRING}\")"
+
+if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
+ echo "$0: with VENDOR_SUFFIX = ${SAMBA_VERSION_VENDOR_SUFFIX}"
+fi
+
+exit 0
diff --git a/source4/smbd/process_thread.c b/source4/smbd/process_thread.c
index d83f48de9f..bd64166355 100644
--- a/source4/smbd/process_thread.c
+++ b/source4/smbd/process_thread.c
@@ -373,7 +373,7 @@ catch serious errors
static void thread_sig_fault(int sig)
{
DEBUG(0,("===============================================================\n"));
- DEBUG(0,("TERMINAL ERROR: Recursive signal %d in thread %lu (%s)\n",sig,(unsigned long int)pthread_self(),SAMBA_VERSION));
+ DEBUG(0,("TERMINAL ERROR: Recursive signal %d in thread %lu (%s)\n",sig,(unsigned long int)pthread_self(),SAMBA_VERSION_STRING));
DEBUG(0,("===============================================================\n"));
exit(1); /* kill the whole server for now */
}
@@ -407,7 +407,7 @@ static void thread_fault_handler(int sig)
counter++; /* count number of faults that have occurred */
DEBUG(0,("===============================================================\n"));
- DEBUG(0,("INTERNAL ERROR: Signal %d in thread %lu (%s)\n",sig,(unsigned long int)pthread_self(),SAMBA_VERSION));
+ DEBUG(0,("INTERNAL ERROR: Signal %d in thread %lu (%s)\n",sig,(unsigned long int)pthread_self(),SAMBA_VERSION_STRING));
DEBUG(0,("Please read the file BUGS.txt in the distribution\n"));
DEBUG(0,("===============================================================\n"));
#ifdef HAVE_BACKTRACE
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 914271100f..67bf07c7f8 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -298,7 +298,7 @@ static void setup_process_model(struct event_context *events,
reopen_logs();
- DEBUG(0,("smbd version %s started.\n", SAMBA_VERSION));
+ DEBUG(0,("smbd version %s started.\n", SAMBA_VERSION_STRING));
DEBUGADD(0,("Copyright Andrew Tridgell and the Samba Team 1992-2004\n"));
/* Output the build options to the debug log */
diff --git a/source4/smbd/sesssetup.c b/source4/smbd/sesssetup.c
index c1ea446c3c..14e300c191 100644
--- a/source4/smbd/sesssetup.c
+++ b/source4/smbd/sesssetup.c
@@ -30,7 +30,7 @@ static void sesssetup_common_strings(struct request_context *req,
char **os, char **lanman, char **domain)
{
(*os) = talloc_asprintf(req->mem_ctx, "Unix");
- (*lanman) = talloc_asprintf(req->mem_ctx, "Samba %s", SAMBA_VERSION);
+ (*lanman) = talloc_asprintf(req->mem_ctx, "Samba %s", SAMBA_VERSION_STRING);
(*domain) = talloc_asprintf(req->mem_ctx, "%s", lp_workgroup());
}