summaryrefslogtreecommitdiff
path: root/util/Makefile.am
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:44 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:44 +0100
commit7551a684bcbc7de7ac3d2e52eea0f9f812affd18 (patch)
tree469d3c40a1c88fcb3ec208a820f7a0fa93dca81c /util/Makefile.am
parentc71717661b7ee871e5bc957f314ad8779e85abc6 (diff)
parentee6c7128ed0d58cb1812049463a13bba9cfb31b7 (diff)
Merge tag 'upstream/2.9.7'
Upstream version 2.9.7
Diffstat (limited to 'util/Makefile.am')
-rw-r--r--util/Makefile.am22
1 files changed, 14 insertions, 8 deletions
diff --git a/util/Makefile.am b/util/Makefile.am
index 16a8665..c3312ac 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -59,8 +59,11 @@ LANPLUS_OBJ = $(shell ar t @LANPLUS_LIB@ 2>/dev/null)
bin_PROGRAMS = ipmiutil ievents idiscover
sbin_PROGRAMS = ipmi_port iseltime
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)
EXTRA_PROGRAMS = ipmi_sample ipmi_sample_evt
TESTPROGS = libimbapi.a iconfig ipmimv ifruset ipmi_sample2 ialarms_enc
# OLDPROGS are old/previous binaries that may exist and need to be deleted.
@@ -98,13 +101,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
@@ -180,7 +186,7 @@ EXTRA_DIST = imb_api.h ipmicmd.h ipmidir.h ipmilan.h ipmilanplus.h AnsiTerm.h i
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)
@@ -191,10 +197,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)