cleanups and fixes for Solaris (issue #4999)

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@245 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Kevin P. Fleming 2005-08-29 19:12:31 +00:00
parent 21d693f0b4
commit 3269a4b034

View File

@ -41,6 +41,8 @@ DYNAMIC_OBJS=copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS) CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
INSTALL_PREFIX= INSTALL_PREFIX=
INSTALL_BASE=/usr INSTALL_BASE=/usr
SOFLAGS = -Wl,-hlibpri.so.1
LDCONFIG = /sbin/ldconfig
ifeq (${OSARCH},Linux) ifeq (${OSARCH},Linux)
LDCONFIG_FLAGS=-n LDCONFIG_FLAGS=-n
else else
@ -50,13 +52,11 @@ CFLAGS += -I../zaptel -I../zapata
endif endif
endif endif
ifeq (${OSARCH},SunOS) ifeq (${OSARCH},SunOS)
CFLAGS += -DSOLARIS -I../zaptel-solaris -lsocket -lnsl CFLAGS += -DSOLARIS -I../zaptel-solaris
SOFLAGS = LDCONFIG =
LDCONFIG = echo LDCONFIG_FLAGS = \# # Trick to comment out the period in the command below
INSTALL_BASE = /usr/local SOSLINK = ln -sf libpri.so.1.0 libpri.so.1
else #INSTALL_PREFIX = /opt/asterisk # Uncomment out to install in standard Solaris location for 3rd party code
SOFLAGS = -Wl,-soname,libpri.so.1
LDCONFIG = /sbin/ldconfig
endif endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only. #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
@ -78,21 +78,29 @@ update:
fi fi
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY) install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/include mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/include
install -m 644 libpri.h $(INSTALL_PREFIX)/$(INSTALL_BASE)/include ifneq (${OSARCH},SunOS)
install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib install -m 644 libpri.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include
if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
( cd $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so ) if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so )
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
$(LDCONFIG) $(LDCONFIG)
else
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 755 $(DYNAMIC_LIBRARY)
( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so ; $(SOSLINK) )
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 644 $(STATIC_LIBRARY)
endif
uninstall: uninstall:
@echo "Removing Libpri" @echo "Removing Libpri"
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.so.1.0 rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.1.0
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.so rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.1
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.a rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/include/libpri.h rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.a
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include/libpri.h
pritest: pritest.o pritest: pritest.o
$(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS) $(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
@ -121,6 +129,7 @@ $(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS) $(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
$(LDCONFIG) $(LDCONFIG_FLAGS) . $(LDCONFIG) $(LDCONFIG_FLAGS) .
ln -sf libpri.so.1 libpri.so ln -sf libpri.so.1 libpri.so
$(SOSLINK)
clean: clean:
rm -f *.o *.so *.lo *.so.1 *.so.1.0 rm -f *.o *.so *.lo *.so.1 *.so.1.0
@ -131,4 +140,4 @@ clean:
depend: .depend depend: .depend
.depend: .depend:
./mkdep ${CFLAGS} `ls *.c` CC=$(CC) ./mkdep ${CFLAGS} `ls *.c`