summaryrefslogtreecommitdiff
path: root/util/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'util/Makefile.in')
-rw-r--r--util/Makefile.in22
1 files changed, 14 insertions, 8 deletions
diff --git a/util/Makefile.in b/util/Makefile.in
index 466c530..a745663 100644
--- a/util/Makefile.in
+++ b/util/Makefile.in
@@ -299,8 +299,11 @@ L2OBJ = @SAM2OBJ@
METASOURCE = ipmiutil.c ialarms.c ihealth.c ievents.c ifru.c ifru_picmg.c igetevent.c ireset.c icmd.c ilan.c isensor.c isel.c iserial.c iwdt.c isol.c idiscover.c iconfig.c ipicmg.c ifirewall.c ifwum.c ihpm.c itsol.c idcmi.c $(OEMMOD) $(CMDMOD)
LANPLUS_OBJ = $(shell ar t @LANPLUS_LIB@ 2>/dev/null)
DEV_LIB = libipmiutil.a
-SHR_LIB = libipmiutil.so
+# SHRLINK is libipmiutil.so.1 if OS supports it
SHRLINK = @SHR_LINK@
+SHR_LIB = $(SHRLINK)
+SHR_BLIB = libipmiutil.so
+LDNAME = -Wl,-soname,$(SHR_LIB)
TESTPROGS = libimbapi.a iconfig ipmimv ifruset ipmi_sample2 ialarms_enc
# OLDPROGS are old/previous binaries that may exist and need to be deleted.
OLDPROGS = alarms bmchealth fruconfig getevent hwreset icmd isolconsole pefconfig sensor showsel tmconfig wdt
@@ -745,13 +748,16 @@ $(SHR_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ @LIBSENSORS@
$(CC) $(CFLAGS_SAMX) -o $(tmpobj)/ipmilanplus.o -c ipmilanplus.c; \
$(CC) $(CFLAGS_SAMX) -o $(tmpobj)/ipmilan.o -c ipmilan.c; \
ar x @LANPLUS_LIB@ ; \
- $(CC) $(LDFLAGS) -shared -o $(SHR_LIB) $(LIBOBJ) $(LANPLUS_OBJ); \
+ $(CC) $(LDFLAGS) -shared $(LDNAME) -o $(SHR_LIB) $(LIBOBJ) $(LANPLUS_OBJ); \
else \
$(CC) $(CFLAGS_SAM) -o $(tmpobj)/ipmilanplus.o -c ipmilanplus.c; \
$(CC) $(CFLAGS_SAM) -o $(tmpobj)/ipmilan.o -c ipmilan.c; \
- $(CC) $(LDFLAGS) -shared -o $(SHR_LIB) $(LIBOBJ) ; \
+ $(CC) $(LDFLAGS) -shared $(LDNAME) -o $(SHR_LIB) $(LIBOBJ) ; \
fi
+$(SHR_BLIB): $(SHR_LIB)
+ ln -s $(SHR_LIB) $(SHR_BLIB)
+
# To build ipmiutil, need to use METACFLAGS for each .c/.o
idiscover$(EXEEXT): idiscover.c
@@ -816,7 +822,7 @@ ipmiutil$(EXEEXT): $(METASOURCE:.c=.o) @LANPLUS_LIB@
all-am: Makefile $(bin_PROGRAMS) $(sbin_PROGRAMS) $(EXTRA_PROGRAMS) $(DEV_LIB) $(SHRLINK)
-install-data-am: $(EXTRA_PROGRAMS) $(DEV_LIB) $(SHRLINK)
+install-data-am: $(EXTRA_PROGRAMS) $(DEV_LIB) $(SHRLINK)
@INS_LIB@ mkdir -p $(DESTDIR)$(extradir)
@INS_LIB@ mkdir -p $(DESTDIR)$(LIBDIR)
@INS_LIB@ mkdir -p $(DESTDIR)$(inc_dir)
@@ -827,10 +833,10 @@ install-data-am: $(EXTRA_PROGRAMS) $(DEV_LIB) $(SHRLINK)
@INS_LIB@ cp -f isensor.h ievents.h $(DESTDIR)$(extradir)
@INS_LIB@ cp -f Makefile.sample $(DESTDIR)$(extradir)/Makefile
@INS_LIB@ cp -f $(DEV_LIB) $(DESTDIR)$(LIBDIR)
- if [ "x$(SHRLINK)" != "x" ]; then \
- touch $(SHRLINK) ; \
- @INS_LIB@ cp -f $(SHR_LIB) $(DESTDIR)$(LIBDIR) ; \
- fi
+ @INS_LIB@ if [ "x$(SHRLINK)" != "x" ]; then \
+ @INS_LIB@ cp -f $(SHRLINK) $(DESTDIR)$(LIBDIR) ; \
+ @INS_LIB@ cd $(DESTDIR); ln -sf $(LIBDIR)/$(SHRLINK) $(DESTDIR)$(LIBDIR)/$(SHR_BLIB); \
+ @INS_LIB@ fi
clean-generic:
rm -f $(DEV_LIB) $(EXTRA_PROGRAMS) $(OLDPROGS) $(TESTPROGS) $(SHRLINK)