Browse Source

PA_GIT_REVISION: new scripts to replace SVN revision

update_gitrevision.sh should be run before building on Mac or Linux.
tags/pa_stable_v190600_20161030
Phil Burk 3 years ago
parent
commit
a553478d71

+ 12
- 0
clear_gitrevision.sh View File

@@ -0,0 +1,12 @@
#!/bin/bash
#
# Clear the Git commit SHA in the include file.
# This should be run before checking in code to Git.
#
revision_filename=src/common/pa_gitrevision.h

# Update the include file with the current GIT revision.
echo "#define PA_GIT_REVISION unknown" > ${revision_filename}

echo ${revision_filename} now contains
cat ${revision_filename}

+ 0
- 12
clear_svnrevision.sh View File

@@ -1,12 +0,0 @@
#!/bin/bash
#
# Clear the SVN revision in the include file.
# This should be run before checking in code to SVN.
#
revision_filename=src/common/pa_svnrevision.h

# Update the include file with the current SVN revision.
echo "#define PA_SVN_REVISION unknown" > ${revision_filename}

echo ${revision_filename} now contains
cat ${revision_filename}

+ 2
- 1
examples/paex_sine.c View File

@@ -113,8 +113,9 @@ int main(void)
paTestData data;
int i;

printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n", SAMPLE_RATE, FRAMES_PER_BUFFER);
printf("%s\n", Pa_GetVersionText());
/* initialise sinusoidal wavetable */
for( i=0; i<TABLE_SIZE; i++ )

+ 4
- 4
src/common/pa_front.c View File

@@ -77,8 +77,8 @@
#include "pa_trace.h" /* still usefull?*/
#include "pa_debugprint.h"

#ifndef PA_SVN_REVISION
#include "pa_svnrevision.h"
#ifndef PA_GIT_REVISION
#include "pa_gitrevision.h"
#endif

/**
@@ -110,7 +110,7 @@
#define TOSTRING(x) STRINGIFY(x)

#define PA_VERSION_STRING_ TOSTRING(paVersionMajor) "." TOSTRING(paVersionMinor) "." TOSTRING(paVersionSubMinor)
#define PA_VERSION_TEXT_ "PortAudio V" PA_VERSION_STRING_ "-devel, revision " TOSTRING(PA_SVN_REVISION)
#define PA_VERSION_TEXT_ "PortAudio V" PA_VERSION_STRING_ "-devel, revision " TOSTRING(PA_GIT_REVISION)

int Pa_GetVersion( void )
{
@@ -126,7 +126,7 @@ static PaVersionInfo versionInfo_ = {
/*.versionMajor =*/ paVersionMajor,
/*.versionMinor =*/ paVersionMinor,
/*.versionSubMinor =*/ paVersionSubMinor,
/*.versionControlRevision =*/ TOSTRING(PA_SVN_REVISION),
/*.versionControlRevision =*/ TOSTRING(PA_GIT_REVISION),
/*.versionText =*/ PA_VERSION_TEXT_
};


+ 1
- 0
src/common/pa_gitrevision.h View File

@@ -0,0 +1 @@
#define PA_GIT_REVISION unknown

+ 0
- 1
src/common/pa_svnrevision.h View File

@@ -1 +0,0 @@
#define PA_SVN_REVISION unknown

+ 17
- 0
update_gitrevision.sh View File

@@ -0,0 +1,17 @@
#!/bin/bash
#
# Write the Git commit SHA to an include file.
# This should be run before compiling code on Linux or Macintosh.
#
revision_filename=src/common/pa_gitrevision.h

# Run git first to make sure it is installed before corrupting the
# include file.
git rev-parse HEAD

# Update the include file with the current Git revision.
echo -n "#define PA_GIT_REVISION " > ${revision_filename}
git rev-parse HEAD >> ${revision_filename}

echo ${revision_filename} now contains
cat ${revision_filename}

+ 0
- 17
update_svnrevision.sh View File

@@ -1,17 +0,0 @@
#!/bin/bash
#
# Write the SVN revision to an include file.
# This should be run before compiling code on Linux or Macintosh.
#
revision_filename=src/common/pa_svnrevision.h

# Run svnversion first to make sure it is installed before corrupting the
# include file.
svnversion .

# Update the include file with the current SVN revision.
echo -n "#define PA_SVN_REVISION " > ${revision_filename}
svnversion . >> ${revision_filename}

echo ${revision_filename} now contains
cat ${revision_filename}

Loading…
Cancel
Save