diff options
Diffstat (limited to 'util/Makefile.am')
-rw-r--r-- | util/Makefile.am | 22 |
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) |