summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-08-20 17:13:38 +0000
committerGerald Carter <jerry@samba.org>2003-08-20 17:13:38 +0000
commit8bfe26b62db2e671b143d93a5428f8fb64a9df05 (patch)
tree37d3f77a451087d3f7491a70bd076e38f977da5a
parent0722fc16a445a47ef3aaa60e7a0e5324bfcf55eb (diff)
downloadsamba-8bfe26b62db2e671b143d93a5428f8fb64a9df05.tar.gz
samba-8bfe26b62db2e671b143d93a5428f8fb64a9df05.tar.bz2
samba-8bfe26b62db2e671b143d93a5428f8fb64a9df05.zip
metze's autogenerate patch for version.h
(This used to be commit ae452e51b02672a56adf18aa7a7e365eeaba9272)
-rw-r--r--source3/Makefile.in21
-rw-r--r--source3/VERSION123
-rwxr-xr-xsource3/autogen.sh5
-rw-r--r--source3/client/client.c2
-rw-r--r--source3/client/smbmnt.c2
-rw-r--r--source3/client/smbmount.c4
-rw-r--r--source3/include/.cvsignore1
-rw-r--r--source3/include/version.h1
-rw-r--r--source3/lib/fault.c2
-rw-r--r--source3/lib/popt_common.c2
-rw-r--r--source3/lib/substitute.c4
-rw-r--r--source3/lib/version.c42
-rw-r--r--source3/libads/ldap.c2
-rw-r--r--source3/libsmb/cliconnect.c2
-rw-r--r--source3/nmbd/nmbd.c2
-rw-r--r--source3/nsswitch/winbindd.c2
-rw-r--r--source3/nsswitch/winbindd_misc.c2
-rw-r--r--source3/param/loadparm.c2
-rwxr-xr-xsource3/script/mkversion.sh87
-rw-r--r--source3/smbd/server.c2
-rw-r--r--source3/smbd/sesssetup.c2
-rw-r--r--source3/torture/rpctorture.c4
-rw-r--r--source3/utils/status.c2
-rw-r--r--source3/web/statuspage.c2
-rw-r--r--source3/wrepld/server.c2
25 files changed, 298 insertions, 24 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 97b61c93ec..0f1bb8173b 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -162,7 +162,7 @@ TDB_OBJ = $(TDBBASE_OBJ) tdb/tdbutil.o tdb/tdbback.o
SMBLDAP_OBJ = @SMBLDAP@
-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/replace1.o \
lib/signal.o lib/system.o lib/sendfile.o lib/time.o \
@@ -494,7 +494,7 @@ CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \
MOUNT_OBJ = client/smbmount.o \
$(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
-MNT_OBJ = client/smbmnt.o
+MNT_OBJ = client/smbmnt.o lib/version.o lib/snprintf.o
UMOUNT_OBJ = client/smbumount.o
@@ -715,6 +715,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 $@
+
smbd/build_options.o: smbd/build_options.c Makefile include/config.h include/build_env.h include/proto.h
@echo Compiling $*.c
@$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@
@@ -1343,6 +1355,11 @@ distclean: realclean
-rm -f config.status config.cache so_locations
-rm -rf .deps
+realdistclean: distclean
+ -rm -f include/config.h.in
+ -rm -f include/version.h
+ -rm -f configure
+
# this target is really just for my use. It only works on a limited
# range of machines and is used to produce a list of potentially
# dead (ie. unused) functions in the code. (tridge)
diff --git a/source3/VERSION b/source3/VERSION
new file mode 100644
index 0000000000..dbded9df70
--- /dev/null
+++ b/source3/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=3
+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=2
+
+########################################################
+# 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=
+
+########################################################
+# 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/source3/autogen.sh b/source3/autogen.sh
index 2d91173f4a..6042b82cdc 100755
--- a/source3/autogen.sh
+++ b/source3/autogen.sh
@@ -55,6 +55,11 @@ $AUTOHEADER || exit 1
echo "$0: running $AUTOCONF"
$AUTOCONF || exit 1
+echo "$0: running script/mkversion.sh"
+./script/mkversion.sh || exit 1
+
+rm -rf autom4te.cache autom4te-2.53.cache
+
echo "Now run ./configure and then make."
exit 0
diff --git a/source3/client/client.c b/source3/client/client.c
index 67fadd11a8..949933b890 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2934,7 +2934,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", VERSION ) );
+ DEBUG(3,("Client started (version %s).\n", SAMBA_VERSION_STRING));
if (tar_type) {
if (cmdstr)
diff --git a/source3/client/smbmnt.c b/source3/client/smbmnt.c
index 0e36231bac..c04be3b7af 100644
--- a/source3/client/smbmnt.c
+++ b/source3/client/smbmnt.c
@@ -38,7 +38,7 @@ help(void)
{
printf("\n");
printf("Usage: smbmnt mount-point [options]\n");
- printf("Version %s\n\n",VERSION);
+ printf("Version %s\n\n",SAMBA_VERSION_STRING);
printf("-s share share name on server\n"
"-r mount read-only\n"
"-u uid mount as uid\n"
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c
index 156130758b..6e8d9f5bca 100644
--- a/source3/client/smbmount.c
+++ b/source3/client/smbmount.c
@@ -663,7 +663,7 @@ static void usage(void)
{
printf("Usage: mount.smbfs service mountpoint [-o options,...]\n");
- printf("Version %s\n\n",VERSION);
+ printf("Version %s\n\n",SAMBA_VERSION_STRING);
printf(
"Options:\n\
@@ -923,7 +923,7 @@ static void parse_mount_smb(int argc, char **argv)
read_credentials_file(credentials);
}
- DEBUG(3,("mount.smbfs started (version %s)\n", VERSION));
+ DEBUG(3,("mount.smbfs started (version %s)\n", SAMBA_VERSION_STRING));
if (*workgroup == 0) {
pstrcpy(workgroup,lp_workgroup());
diff --git a/source3/include/.cvsignore b/source3/include/.cvsignore
index bff248727f..7dff121f14 100644
--- a/source3/include/.cvsignore
+++ b/source3/include/.cvsignore
@@ -4,3 +4,4 @@ stamp-h
proto.h
wrepld_proto.h
config.h.in
+version.h
diff --git a/source3/include/version.h b/source3/include/version.h
deleted file mode 100644
index 68bc140daf..0000000000
--- a/source3/include/version.h
+++ /dev/null
@@ -1 +0,0 @@
-#define VERSION "3.0.0rc1"
diff --git a/source3/lib/fault.c b/source3/lib/fault.c
index a9e1b7bbb9..df7830ef83 100644
--- a/source3/lib/fault.c
+++ b/source3/lib/fault.c
@@ -34,7 +34,7 @@ static void fault_report(int sig)
counter++;
DEBUG(0,("===============================================================\n"));
- DEBUG(0,("INTERNAL ERROR: Signal %d in pid %d (%s)",sig,(int)sys_getpid(),VERSION));
+ DEBUG(0,("INTERNAL ERROR: Signal %d in pid %d (%s)",sig,(int)sys_getpid(),SAMBA_VERSION_STRING));
DEBUG(0,("\nPlease read the appendix Bugs of the Samba HOWTO collection\n"));
DEBUG(0,("===============================================================\n"));
diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c
index 95a9a58b34..9a5a112022 100644
--- a/source3/lib/popt_common.c
+++ b/source3/lib/popt_common.c
@@ -69,7 +69,7 @@ static void popt_common_callback(poptContext con,
break;
case 'V':
- printf( "Version %s\n", VERSION );
+ printf( "Version %s\n", SAMBA_VERSION_STRING);
exit(0);
break;
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index c0d0096806..71c7b9ab1c 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -384,7 +384,7 @@ void standard_sub_basic(const char *smb_name, char *str,size_t len)
string_sub(p,"%m", get_remote_machine_name(),l);
break;
case 'v' :
- string_sub(p,"%v", VERSION,l);
+ string_sub(p,"%v", SAMBA_VERSION_STRING,l);
break;
case '$' :
p += expand_env_var(p,l);
@@ -539,7 +539,7 @@ char *alloc_sub_basic(const char *smb_name, const char *str)
t = realloc_string_sub(t, "%m", remote_machine);
break;
case 'v' :
- t = realloc_string_sub(t, "%v", VERSION);
+ t = realloc_string_sub(t, "%v", SAMBA_VERSION_STRING);
break;
case '$' :
t = realloc_expand_env_var(t, p); /* Expand environment variables */
diff --git a/source3/lib/version.c b/source3/lib/version.c
new file mode 100644
index 0000000000..99f836c2d5
--- /dev/null
+++ b/source3/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/source3/libads/ldap.c b/source3/libads/ldap.c
index 5a12288b16..3de119b5d9 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1045,7 +1045,7 @@ static ADS_STATUS ads_add_machine_acct(ADS_STRUCT *ads, const char *hostname,
ads_mod_str(ctx, &mods, "dNSHostName", hostname);
ads_mod_str(ctx, &mods, "userAccountControl", controlstr);
ads_mod_str(ctx, &mods, "operatingSystem", "Samba");
- ads_mod_str(ctx, &mods, "operatingSystemVersion", VERSION);
+ ads_mod_str(ctx, &mods, "operatingSystemVersion", SAMBA_VERSION_STRING);
ret = ads_gen_add(ads, new_dn, mods);
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index ca492e0a1c..bb0712d989 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -190,7 +190,7 @@ static BOOL cli_session_setup_plaintext(struct cli_state *cli, const char *user,
char *p;
fstring lanman;
- fstr_sprintf( lanman, "Samba %s", VERSION );
+ fstr_sprintf( lanman, "Samba %s", SAMBA_VERSION_STRING);
set_message(cli->outbuf,13,0,True);
SCVAL(cli->outbuf,smb_com,SMBsesssetupX);
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 2801e54551..fd648a4a27 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -659,7 +659,7 @@ static BOOL open_sockets(BOOL isdaemon, int port)
reopen_logs();
- DEBUG( 0, ( "Netbios nameserver version %s started.\n", VERSION ) );
+ DEBUG( 0, ( "Netbios nameserver version %s started.\n", SAMBA_VERSION_STRING) );
DEBUGADD( 0, ( "Copyright Andrew Tridgell and the Samba Team 1994-2003\n" ) );
if ( !reload_nmbd_services(False) )
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index 313161f5fa..e6a1c8290b 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -835,7 +835,7 @@ int main(int argc, char **argv)
setup_logging("winbindd", log_stdout);
reopen_logs();
- DEBUG(1, ("winbindd version %s started.\n", VERSION ) );
+ DEBUG(1, ("winbindd version %s started.\n", SAMBA_VERSION_STRING) );
DEBUGADD( 1, ( "Copyright The Samba Team 2000-2003\n" ) );
if (!reload_services_file(False)) {
diff --git a/source3/nsswitch/winbindd_misc.c b/source3/nsswitch/winbindd_misc.c
index d2d50c52ac..c12fe4517e 100644
--- a/source3/nsswitch/winbindd_misc.c
+++ b/source3/nsswitch/winbindd_misc.c
@@ -206,7 +206,7 @@ enum winbindd_result winbindd_info(struct winbindd_cli_state *state)
DEBUG(3, ("[%5lu]: request misc info\n", (unsigned long)state->pid));
state->response.data.info.winbind_separator = *lp_winbind_separator();
- fstrcpy(state->response.data.info.samba_version, VERSION);
+ fstrcpy(state->response.data.info.samba_version, SAMBA_VERSION_STRING);
return WINBINDD_OK;
}
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 4a2fffc757..17c82d5e13 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1340,7 +1340,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, 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/source3/script/mkversion.sh b/source3/script/mkversion.sh
new file mode 100755
index 0000000000..ca39297940
--- /dev/null
+++ b/source3/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/source3/smbd/server.c b/source3/smbd/server.c
index 453ff54e4b..8b890549ea 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -744,7 +744,7 @@ void build_options(BOOL screen);
reopen_logs();
- DEBUG(0,( "smbd version %s started.\n", VERSION));
+ DEBUG(0,( "smbd version %s started.\n", SAMBA_VERSION_STRING));
DEBUGADD(0,( "Copyright Andrew Tridgell and the Samba Team 1992-2003\n"));
DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n",
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 242b39d8d7..e7fc6254e5 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -62,7 +62,7 @@ static int add_signature(char *outbuf, char *p)
char *start = p;
fstring lanman;
- fstr_sprintf( lanman, "Samba %s", VERSION );
+ fstr_sprintf( lanman, "Samba %s", SAMBA_VERSION_STRING);
p += srvstr_push(outbuf, p, "Unix", -1, STR_TERMINATE);
p += srvstr_push(outbuf, p, lanman, -1, STR_TERMINATE);
diff --git a/source3/torture/rpctorture.c b/source3/torture/rpctorture.c
index 8dfaebd64f..d95c0cee0f 100644
--- a/source3/torture/rpctorture.c
+++ b/source3/torture/rpctorture.c
@@ -193,7 +193,7 @@ static void usage(char *pname)
fprintf(out_hnd, "Usage: %s service <password> [-d debuglevel] [-l log] ",
pname);
- fprintf(out_hnd, "\nVersion %s\n",VERSION);
+ fprintf(out_hnd, "\nVersion %s\n",SAMBA_VERSION_STRING);
fprintf(out_hnd, "\t-d debuglevel set the debuglevel\n");
fprintf(out_hnd, "\t-l log basename. Basename for log/debug files\n");
fprintf(out_hnd, "\t-n netbios name. Use this name as my netbios name\n");
@@ -489,7 +489,7 @@ enum client_action
strupper_m(global_myname);
fstrcpy(cli_info.myhostname, global_myname);
- DEBUG(3,("%s client started (version %s)\n",timestring(False),VERSION));
+ DEBUG(3,("%s client started (version %s)\n",timestring(False),SAMBA_VERSION_STRING));
if (*smb_cli->domain == 0)
{
diff --git a/source3/utils/status.c b/source3/utils/status.c
index 8bf67fc4d6..c17e080b6b 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -597,7 +597,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
} else {
if (locks_only) goto locks;
- d_printf("\nSamba version %s\n",VERSION);
+ d_printf("\nSamba version %s\n",SAMBA_VERSION_STRING);
d_printf("PID Username Group Machine \n");
d_printf("-------------------------------------------------------------------\n");
diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c
index c579e8f112..21d7e45738 100644
--- a/source3/web/statuspage.c
+++ b/source3/web/statuspage.c
@@ -327,7 +327,7 @@ void status_page(void)
d_printf("<table>\n");
- d_printf("<tr><td>%s</td><td>%s</td></tr>", _("version:"), VERSION);
+ d_printf("<tr><td>%s</td><td>%s</td></tr>", _("version:"), SAMBA_VERSION_STRING);
fflush(stdout);
d_printf("<tr><td>%s</td><td>%s</td>\n", _("smbd:"), smbd_running()?_("running"):_("not running"));
diff --git a/source3/wrepld/server.c b/source3/wrepld/server.c
index 504818b8d5..25de680982 100644
--- a/source3/wrepld/server.c
+++ b/source3/wrepld/server.c
@@ -586,7 +586,7 @@ static void process(void)
reopen_logs();
- DEBUG(1,( "wrepld version %s started.\n", VERSION));
+ DEBUG(1,( "wrepld version %s started.\n", SAMBA_VERSION_STRING));
DEBUGADD(1,( "Copyright Andrew Tridgell and the Samba Team 1992-2002\n"));
DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n",