summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-05-21 18:37:15 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-05-21 18:37:15 +0000
commited79a05a94293fd8c2516ac2c9118fa20276727b (patch)
tree5bf1045bbac47525d8a13cdffff4437831be04ac /Makefile
parentedfd73987bfdd47cad0ebbba9f6dfcda3a5cc8b0 (diff)
clean up soname and version number handling for libtonezone.so
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@652 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile27
1 files changed, 15 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 5ceabca..3dd6880 100755
--- a/Makefile
+++ b/Makefile
@@ -92,7 +92,9 @@ CHKCONFIG:=:
endif
TZOBJS:=zonedata.lo tonezone.lo
-LIBTONEZONE:=libtonezone.so.1.0
+LIBTONEZONE_SO:=libtonezone.so
+LIBTONEZONE_SO_MAJOR_VER:=1
+LIBTONEZONE_SO_MINOR_VER:=0
MODULES:=zaptel tor2 torisa wcusb wcfxo wctdm \
ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp pciradio \
ztd-loc # ztdummy
@@ -114,7 +116,7 @@ PRIMARY=torisa
#PRIMARY=wcfxo
PWD:=$(shell pwd)
-all: $(BUILDVER) $(LIBTONEZONE)
+all: $(BUILDVER) $(LIBTONEZONE_SO)
linux24: $(MODULESO) $(BINS)
@@ -226,18 +228,18 @@ sethdlc-new.o: sethdlc-new.c
libtonezone.a: $(TZOBJS)
ar rcs libtonezone.a $(TZOBJS)
-$(LIBTONEZONE): $(TZOBJS)
- $(CC) -shared -Wl,-soname,$(LIBTONEZONE) -lm -o $@ $^
+$(LIBTONEZONE_SO): $(TZOBJS)
+ $(CC) -shared -Wl,-soname,$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER) -lm -o $@ $^
ztcfg.c: ztcfg.h
-ztcfg-shared: ztcfg.o $(LIBTONEZONE)
+ztcfg-shared: ztcfg.o $(LIBTONEZONE_SO)
$(CC) -o $@ $^ -lm
ztcfg: ztcfg.o libtonezone.a
$(CC) -o $@ $^ -lm
-ztcfg-dude: ztcfg-dude.o mknotch.o complex.o $(LIBTONEZONE)
+ztcfg-dude: ztcfg-dude.o mknotch.o complex.o $(LIBTONEZONE_SO)
$(CC) -o $@ $^ -lm
mknotch.o: mknotch.cc
@@ -252,7 +254,7 @@ usbfxstest.o: usbfxstest.c
usbfxstest: usbfxstest.o
$(CC) -o $@ $^ -lzap
-fxstest: fxstest.o $(LIBTONEZONE)
+fxstest: fxstest.o $(LIBTONEZONE_SO)
$(CC) -o $@ $^ -lm
fxotune: fxotune.o
@@ -316,13 +318,14 @@ install: all devices
fi; \
rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o; \
fi
- install -D -m 755 $(LIBTONEZONE) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE)
- if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE); fi
+ install -D -m 755 $(LIBTONEZONE_SO) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER)
+ [ `id -u` = 0 ] && /sbin/ldconfig || :
+ rm -f $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
+ ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
+ if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi
install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h
install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h
install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h
- rm -f $(INSTALL_PREFIX)/usr/lib/libtonezone.so
- rm -f $(INSTALL_PREFIX)/usr/lib/libtonezone.so.1
if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi
cat $(MODCONF).bak | grep -v "alias char-major-250" | \
grep -v "post-install torisa /sbin/ztcfg" | \
@@ -388,7 +391,7 @@ clean:
rm -f torisatool makefw tor2fw.h radfw.h
rm -f ${BINS}
rm -f *.o ztcfg tzdriver sethdlc sethdlc-new
- rm -f $(TZOBJS) $(LIBTONEZONE) *.lo
+ rm -f $(TZOBJS) $(LIBTONEZONE_SO) *.lo
rm -f *.ko *.mod.c .*o.cmd
rm -rf .tmp_versions
rm -f gendigits tones.h