From 2d72446860abac08dc4f36b10fde7536f7897956 Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Wed, 17 Dec 2008 20:16:55 +0000 Subject: More CMake work, mostly to handle both *nix and Windows builds. Also some tweaks to generation files (like version.sh) to take both input and output files as arguments, to handle CMake when it's used for an out-of-source build. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1836 5417fbe8-f217-4b02-8779-1006273d7864 --- include/version.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include/version.sh') diff --git a/include/version.sh b/include/version.sh index 962896e6b..77e2d5f3a 100644 --- a/include/version.sh +++ b/include/version.sh @@ -3,8 +3,8 @@ # Build version string and increment Services build number. # -if [ $# -lt 1 ] ; then - echo "Syntax: $0 " +if [ $# -lt 2 ] ; then + echo "Syntax: $0 " exit 1 fi # Grab version information from the version control file. @@ -19,8 +19,9 @@ fi VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_EXTRA} (${VERSION_BUILD})" VERSIONDOTTED="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_EXTRA}.${VERSION_BUILD}" -if [ -f version.h ] ; then - BUILD=`fgrep '#define BUILD' version.h | cut -f2 -d\"` +VERSIONH="$2" +if [ -f $VERSIONH ] ; then + BUILD=`fgrep '#define BUILD' $VERSIONH | cut -f2 -d\"` BUILD=`expr $BUILD + 1 2>/dev/null` else BUILD=1 @@ -28,7 +29,7 @@ fi if [ ! "$BUILD" ] ; then BUILD=1 fi -cat >version.h <$VERSIONH <