diff --git a/Makefile.am b/Makefile.am index 79914e18ba..4e40f63fb8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -161,13 +161,20 @@ install-data-local: touch .version src/include/switch_version.h: $(top_srcdir)/src/include/switch_version.h.in .version $(libfreeswitch_la_SOURCES) $(library_include_HEADERS) - @force=0 ; \ - version=`svnversion . -n || echo hacked` ; \ - oldversion=`cat .version 2>/dev/null || echo "0"` ; \ - test ! -f src/include/switch_version.h || grep "@SVN_VERSION@" src/include/switch_version.h && force=1 ; \ - if test "$$oldversion" != "$$version" || test $$force = 1 ; then \ - cat src/include/switch_version.h.in | sed "s/@SVN_VERSION@/$$version/g" > src/include/switch_version.h ; \ - echo $$version > .version ; \ + @have_version=1 ; \ + force=0 ; \ + grep "@SWITCH_VERSION_REVISION@" src/include/switch_version.h.in > /dev/null && have_version=0 ; \ + test ! -f src/include/switch_version.h || grep "@SWITCH_VERSION_REVISION@" src/include/switch_version.h > /dev/null && force=1 ; \ + if test $$have_version = 1 ; then \ + cat src/include/switch_version.h.in > src/include/switch_version.h ; \ + touch .version ; \ + else \ + version=`svnversion . -n || echo hacked` ; \ + oldversion=`cat .version 2>/dev/null || echo "0"` ; \ + if test "$$oldversion" != "$$version" || test $$force = 1 ; then \ + cat src/include/switch_version.h.in | sed "s/@SWITCH_VERSION_REVISION@/$$version/g" > src/include/switch_version.h ; \ + echo $$version > .version ; \ + fi ; \ fi ; update: diff --git a/configure.in b/configure.in index adb6d80b70..c10f687d30 100644 --- a/configure.in +++ b/configure.in @@ -1,8 +1,16 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. +# Must change all of the below together +# For a release, set revision for that tagged release as well and uncomment +AC_INIT([freeswitch], [1.0.pre1], BUG-REPORT-ADDRESS) +AC_SUBST(SWITCH_VERSION_MAJOR, [1]) +AC_SUBST(SWITCH_VERSION_MINOR, [0]) +AC_SUBST(SWITCH_VERSION_MICRO, [pre1]) +#AC_SUBST(SWITCH_VERSION_REVISION, [svn-revision-here]) + +AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template]) -AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) AC_CONFIG_AUX_DIR(build/config) AM_INIT_AUTOMAKE(libfreeswitch,0.1) AC_CONFIG_SRCDIR([src/switch.c]) diff --git a/src/include/switch_version.h.in b/src/include/switch_version.h.template similarity index 85% rename from src/include/switch_version.h.in rename to src/include/switch_version.h.template index b2ef713585..c7511487d4 100644 --- a/src/include/switch_version.h.in +++ b/src/include/switch_version.h.template @@ -37,10 +37,10 @@ extern "C" { #endif -#define SWITCH_VERSION_MAJOR "1" -#define SWITCH_VERSION_MINOR "0" -#define SWITCH_VERSION_MICRO "pre1" -#define SWITCH_VERSION_REVISION "@SVN_VERSION@" +#define SWITCH_VERSION_MAJOR "@SWITCH_VERSION_MAJOR@" +#define SWITCH_VERSION_MINOR "@SWITCH_VERSION_MINOR@" +#define SWITCH_VERSION_MICRO "@SWITCH_VERSION_MICRO@" +#define SWITCH_VERSION_REVISION "@SWITCH_VERSION_REVISION@" #define SWITCH_VERSION_FULL SWITCH_VERSION_MAJOR "." SWITCH_VERSION_MINOR "." SWITCH_VERSION_MICRO " (" SWITCH_VERSION_REVISION ")" #ifdef __cplusplus diff --git a/w32/Library/FreeSwitchCore.vcproj b/w32/Library/FreeSwitchCore.vcproj index f79719a839..cdcf9ba837 100644 --- a/w32/Library/FreeSwitchCore.vcproj +++ b/w32/Library/FreeSwitchCore.vcproj @@ -576,7 +576,7 @@ Name="Generated Header Files" > @@ -615,7 +615,7 @@