0

I compiled a program with a static library libpolarssl.a

I would like to create a README with the library version.

Is there a programmatic way to get the version of this library?

Daniel Roethlisberger
  • 6,958
  • 2
  • 41
  • 59
Zombo
  • 1
  • 62
  • 391
  • 407

2 Answers2

1

Polar SSL has an internal version number and the wrappers to export it to your application, see:

http://polarssl.org/apidoc/version_8h.html

// Get the version number
unsigned int version_get_number(void);

// Get the version string ("x.y.z")
void version_get_string(char *string);

// Get the full version string ("PolarSSL x.y.z")
void version_get_string_full(char *string);

Easy right?

Gil
  • 3,279
  • 1
  • 15
  • 25
0

I ended up writing a a script to do this

vr ()
{
  printf "#include <$2>\n$1" > a.c
  read $1 < <($CC -E a.c | sed '$!d; s/"//g')
}

vr POLARSSL_VERSION_STRING polarssl/version.h
Zombo
  • 1
  • 62
  • 391
  • 407