fix Solaris compatibility issues (bug #4339)
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 20 May 2005 03:18:35 +0000 (03:18 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 20 May 2005 03:18:35 +0000 (03:18 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5747 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
ast_expr2.fl
ast_expr2.y
res/Makefile

index c959baf..95f4ef0 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -512,7 +512,7 @@ update:
                if [ -f patches/.applied ]; then \
                        patches=`cat patches/.applied`; \
                fi; \
                if [ -f patches/.applied ]; then \
                        patches=`cat patches/.applied`; \
                fi; \
-               if ! [ -z "$$patches" ]; then \
+               if [ ! -z "$$patches" ]; then \
                        for x in $$patches; do \
                                echo "Unapplying $$x..."; \
                                patch -R -p0 < patches/$$x; \
                        for x in $$patches; do \
                                echo "Unapplying $$x..."; \
                                patch -R -p0 < patches/$$x; \
@@ -527,7 +527,7 @@ update:
                        grep ^C update.out | cut -d' ' -f2- ; \
                fi ; \
                rm -f update.out; \
                        grep ^C update.out | cut -d' ' -f2- ; \
                fi ; \
                rm -f update.out; \
-               if ! [ -z "$$patches" ]; then \
+               if [ ! -z "$$patches" ]; then \
                        for x in $$patches; do \
                                if [ -f patches/$$x ]; then \
                                        echo "Applying patch $$x..."; \
                        for x in $$patches; do \
                                if [ -f patches/$$x ]; then \
                                        echo "Applying patch $$x..."; \
@@ -638,7 +638,7 @@ upgrade: all bininstall
 adsi: all
        mkdir -p $(DESTDIR)$(ASTETCDIR)
        for x in configs/*.adsi; do \
 adsi: all
        mkdir -p $(DESTDIR)$(ASTETCDIR)
        for x in configs/*.adsi; do \
-               if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+               if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
                        install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
                fi ; \
        done
                        install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
                fi ; \
        done
@@ -806,7 +806,7 @@ env:
 # We can avoid this by making noclean
 
 cleantest:
 # We can avoid this by making noclean
 
 cleantest:
-       if ! cmp -s .cleancount .lastclean ; then \
+       if cmp -s .cleancount .lastclean ; then echo ; else \
                $(MAKE) clean; cp -f .cleancount .lastclean;\
        fi
 
                $(MAKE) clean; cp -f .cleancount .lastclean;\
        fi
 
@@ -840,7 +840,7 @@ apply:
 unapply: 
        @if [ -z "$(PATCH)" ]; then \
                echo "Usage: make PATCH=<patchname> unapply"; \
 unapply: 
        @if [ -z "$(PATCH)" ]; then \
                echo "Usage: make PATCH=<patchname> unapply"; \
-       elif ! grep -q ^$(PATCH)$$ patches/.applied 2>/dev/null; then \
+       elif grep -v -q ^$(PATCH)$$ patches/.applied 2>/dev/null; then \
                echo "Patch $(PATCH) is not applied"; \
        elif [ -f "patches/$(PATCH)" ]; then \
                echo "Un-applying patch $(PATCH)"; \
                echo "Patch $(PATCH) is not applied"; \
        elif [ -f "patches/$(PATCH)" ]; then \
                echo "Un-applying patch $(PATCH)"; \
index fc56994..452d28f 100755 (executable)
@@ -5,7 +5,11 @@
 #include <string.h>
 #include <locale.h>
 #include <ctype.h>
 #include <string.h>
 #include <locale.h>
 #include <ctype.h>
+#ifndef SOLARIS
 #include <err.h>
 #include <err.h>
+#else
+#define quad_t uint64_t
+#endif
 #include <errno.h>
 #include <regex.h>
 #include <limits.h>
 #include <errno.h>
 #include <regex.h>
 #include <limits.h>
index be78d46..14c84e8 100755 (executable)
 #include <string.h>
 #include <locale.h>
 #include <ctype.h>
 #include <string.h>
 #include <locale.h>
 #include <ctype.h>
+#ifndef SOLARIS
 #include <err.h>
 #include <err.h>
+#else
+#define quad_t uint64_t
+#endif
 #include <errno.h>
 #include <regex.h>
 #include <limits.h>
 #include <errno.h>
 #include <regex.h>
 #include <limits.h>
index df06973..0e8d3ae 100755 (executable)
@@ -58,14 +58,16 @@ endif
 depend: .depend
 
 .depend:
 depend: .depend
 
 .depend:
-       @if ! which mpg123 &>/dev/null ; then \
-               echo "*** You don't have mpg123 installed. You're going to need ***";\
-               echo "***       it if you want MusicOnHold                      ***";\
-       elif ! mpg123 --longhelp 2>&1 | grep .59r &>/dev/null ; then \
+       @if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \
+         if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \
                        echo "*************************************************************";\
                        echo "*** You have the WRONG version of mpg123... you need .59r ***";\
                        echo "*** Use 'make mpg123' to get the right verison            ***";\
                        echo "*************************************************************";\
                        echo "*************************************************************";\
                        echo "*** You have the WRONG version of mpg123... you need .59r ***";\
                        echo "*** Use 'make mpg123' to get the right verison            ***";\
                        echo "*************************************************************";\
+         fi ;\
+       else \
+               echo "*** You don't have mpg123 installed. You're going to need ***";\
+               echo "***       it if you want MusicOnHold                      ***";\
        fi
        ../mkdep $(CFLAGS) `ls *.c`     
 
        fi
        ../mkdep $(CFLAGS) `ls *.c`