summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-09 20:12:14 -0400
committermidipix <writeonce@midipix.org>2016-04-09 20:12:14 -0400
commitcd3d414b8ebb378b0972d89e9ae1bd83ea3794f6 (patch)
treebee511701af41f2f457314699ae2cfd72f61c5ad
parent5e1c21de3bc7cedf1a2673442fcf74f9f6c6eaca (diff)
downloadslibtool-cd3d414b8ebb378b0972d89e9ae1bd83ea3794f6.tar.bz2
slibtool-cd3d414b8ebb378b0972d89e9ae1bd83ea3794f6.tar.xz
driver: added -version-number support.
-rw-r--r--include/slibtool/slibtool.h1
-rw-r--r--src/driver/slbt_driver_ctx.c16
-rw-r--r--src/internal/slibtool_driver_impl.h1
-rw-r--r--src/skin/slbt_skin_default.c5
4 files changed, 23 insertions, 0 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index dbc6897..cfad114 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -117,6 +117,7 @@ struct slbt_version_info {
int minor;
int revision;
const char * verinfo;
+ const char * vernumber;
};
struct slbt_host_params {
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 726bb12..29aff8b 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -243,6 +243,10 @@ static int slbt_split_argv(
*targv++ = argv[i++];
*targv++ = argv[i];
+ } else if (!(strcmp("version-number",&argv[i][1]))) {
+ *targv++ = argv[i++];
+ *targv++ = argv[i];
+
} else {
for (option=options; option->long_name; option++)
if (!(strcmp(option->long_name,&argv[i][1])))
@@ -432,6 +436,14 @@ static int slbt_init_version_info(
int revision;
int age;
+ if (verinfo->vernumber) {
+ sscanf(verinfo->vernumber,"%d:%d:%d",
+ &verinfo->major,
+ &verinfo->minor,
+ &verinfo->revision);
+ return 0;
+ }
+
sscanf(verinfo->verinfo,"%d:%d:%d",
&current,&revision,&age);
@@ -691,6 +703,10 @@ int slbt_get_driver_ctx(
cctx.verinfo.verinfo = entry->arg;
break;
+ case TAG_VERSION_NUMBER:
+ cctx.verinfo.vernumber = entry->arg;
+ break;
+
case TAG_TARGET:
cctx.target = entry->arg;
break;
diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h
index fbb6d3b..5e7edad 100644
--- a/src/internal/slibtool_driver_impl.h
+++ b/src/internal/slibtool_driver_impl.h
@@ -35,6 +35,7 @@ enum app_tags {
TAG_RPATH,
TAG_RELEASE,
TAG_VERSION_INFO,
+ TAG_VERSION_NUMBER,
TAG_NO_SUPPRESS,
TAG_PREFER_PIC,
TAG_PREFER_NON_PIC,
diff --git a/src/skin/slbt_skin_default.c b/src/skin/slbt_skin_default.c
index 7c421f6..26588c4 100644
--- a/src/skin/slbt_skin_default.c
+++ b/src/skin/slbt_skin_default.c
@@ -95,6 +95,11 @@ const struct argv_option slbt_default_options[] = {
"<current>[:<revision>[:<age>]]",
"specify version information"},
+ {"version-number", 0,TAG_VERSION_NUMBER,ARGV_OPTARG_REQUIRED,
+ ARGV_OPTION_HYBRID_ONLY|ARGV_OPTION_HYBRID_SPACE,0,
+ "<major>[:<minor>[:<revision>]]",
+ "specify version information"},
+
{"no-suppress", 0,TAG_NO_SUPPRESS,ARGV_OPTARG_NONE,
ARGV_OPTION_HYBRID_ONLY,0,0,
"transparently forward all "