From 4ca9cd5d72b6ebe268a75ed052a70c66a1012c30 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 16 Jun 2009 22:17:38 +0000 Subject: [PATCH] Giving libraries an soname --- src/makefile.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/makefile.c b/src/makefile.c index 4566032..fb9a952 100644 --- a/src/makefile.c +++ b/src/makefile.c @@ -888,8 +888,12 @@ static int _target_library(Configure * configure, FILE * fp, if((p = config_get(configure->config, target, "depends")) != NULL) fprintf(fp, " %s", p); fputc('\n', fp); - fprintf(fp, "%s%s%s%s%s", "\t$(LD) -o ", target, ".so $(", target, - "_OBJS)"); + fprintf(fp, "%s%s%s", "\t$(LD) -o ", target, ".so"); + if((p = config_get(configure->config, target, "soname")) == NULL) + fprintf(fp, "%s%s%s", " -Wl,-soname,", target, ".so.0"); + else + fprintf(fp, "%s%s", " -Wl,-soname,", p); + fprintf(fp, "%s%s%s", " $(", target, "_OBJS)"); if((p = config_get(configure->config, target, "ldflags")) != NULL) fprintf(fp, " %s", p); if(q != NULL)