summaryrefslogtreecommitdiffhomepage
path: root/src/internal/slibtool_objmeta_impl.c
diff options
context:
space:
mode:
authorSebastian Wiedenroth <wiedi@frubar.net>2016-09-29 01:16:08 +0200
committermidipix <writeonce@midipix.org>2016-09-30 20:12:58 -0400
commitec296aac58b0c9afd185951427d75da1229b9f19 (patch)
tree4a70d2ab8d9be2bc98657f49fc3e654a816d3396 /src/internal/slibtool_objmeta_impl.c
parent1a80187272e31b04b09f663bd837b7c584442925 (diff)
downloadslibtool-ec296aac58b0c9afd185951427d75da1229b9f19.tar.bz2
slibtool-ec296aac58b0c9afd185951427d75da1229b9f19.tar.xz
library: helper functions: implemented compatible library and objects wrappers.
+ based on work by jperkin (as well as slibtool's default wrapper functions). + generate verbose .la/.lo wrappers that match gnu libtool's output. + dependency_libs string is currently empty, to be added in a separate patch. + ordering of library_names is different, should (probably) not matter.
Diffstat (limited to 'src/internal/slibtool_objmeta_impl.c')
-rw-r--r--src/internal/slibtool_objmeta_impl.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/internal/slibtool_objmeta_impl.c b/src/internal/slibtool_objmeta_impl.c
index 9e9cc75..65d67ea 100644
--- a/src/internal/slibtool_objmeta_impl.c
+++ b/src/internal/slibtool_objmeta_impl.c
@@ -50,8 +50,44 @@ static int slbt_create_compatible_object_wrapper(
const struct slbt_driver_ctx * dctx,
struct slbt_exec_ctx * ectx)
{
- /* awaiting submission */
- return slbt_create_default_object_wrapper(dctx,ectx);
+ int ret;
+ FILE * fout;
+ const struct slbt_source_version * verinfo;
+
+ if (!(fout = fopen(ectx->ltobjname,"w")))
+ return SLBT_SYSTEM_ERROR(dctx);
+
+ verinfo = slbt_source_version();
+
+ ret = fprintf(fout,
+ "# %s - a libtool object file\n"
+ "# Generated by %s (slibtool %d.%d.%d)\n"
+ "# [commit reference: %s]\n"
+ "#\n"
+ "# Please DO NOT delete this file!\n"
+ "# It is necessary for linking the library.\n\n"
+
+ "# Name of the PIC object.\n"
+ "pic_object='%s'\n\n"
+
+ "# Name of the non-PIC object\n"
+ "non_pic_object='%s'\n",
+
+ ectx->ltobjname,
+ dctx->program,
+ verinfo->major,verinfo->minor,verinfo->revision,
+ verinfo->commit,
+
+ (dctx->cctx->drvflags & SLBT_DRIVER_SHARED)
+ ? ectx->lobjname
+ : "none",
+ (dctx->cctx->drvflags & SLBT_DRIVER_STATIC)
+ ? ectx->aobjname
+ : "none");
+
+ return (ret <= 0) || fclose(fout)
+ ? SLBT_SYSTEM_ERROR(dctx)
+ : 0;
}
int slbt_create_object_wrapper(