From c9aefa91df23de57e57818840555171bf4c831a1 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 10 Dec 2018 06:48:56 -0800 Subject: Updated to use git for versions. --- autoconfig.cpp | 20 +++++++++++++------- default.bld | 4 ++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/autoconfig.cpp b/autoconfig.cpp index 0df3dbd..244fedf 100644 --- a/autoconfig.cpp +++ b/autoconfig.cpp @@ -130,15 +130,21 @@ int main( int argc, char *argv[] ) fprintf( fOut, "#ifndef BU_VERSION_H\n" "#define BU_VERSION_H\n\n" - "#define LIBBU_VERSION 0\n" - "#define LIBBU_REVISION 1\n" - "#define LIBBU_VERSION_STR \"%s\"\n" - "#define LIBBU_API 0\n" - "#define LIBBU_VC_ID \"", + "#define LIBBU_VERSION 0\n" + "#define LIBBU_REVISION 1\n" + "#define LIBBU_VERSION_STR \"%s\"\n" + "#define LIBBU_API 0\n" + "#define LIBBU_VC_ID \"", buf ); - FILE *psub = popen("svnversion -n", "r"); - fwrite( buf, fread( buf, 1, 1024, psub ), 1, fOut ); + + char buf2[1024]; + FILE *psub = popen("git describe --always", "r"); + buf2[fread( buf2, 1, 1024, psub )] = '\0'; + for( int j = 0; buf2[j]; j++ ) + if( buf2[j] == '\n' ) + buf2[j] = '\0'; + fwrite( buf2, strlen(buf2), 1, fOut ); pclose( psub ); fprintf( fOut, "\"\n\n#endif\n"); } diff --git a/default.bld b/default.bld index c471744..68bd049 100644 --- a/default.bld +++ b/default.bld @@ -61,7 +61,7 @@ target ["src/autoconfig.h", "src/version.h"] target "src/version.h" { - input ".svn"; + input ".git"; } target "src/signals.h" @@ -178,7 +178,7 @@ target "src/extra/myriadfs.o" target "myriadfs" { - LDFLAGS += "-lfuse"; + LDFLAGS += "-lfuse -lpthread"; } target "bin2cpp" -- cgit v1.2.3