]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a few build issues in Solaris (and likely others).
authorJason Parker <jparker@digium.com>
Wed, 22 Aug 2007 18:53:18 +0000 (18:53 +0000)
committerJason Parker <jparker@digium.com>
Wed, 22 Aug 2007 18:53:18 +0000 (18:53 +0000)
Use GREP and ID variables from autoconf.

Reported to me in #asterisk-dev
I forgot who reported this - sorry. :(

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80330 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
build_tools/make_build_h
build_tools/make_buildopts_h
build_tools/mkpkgconfig
build_tools/prep_moduledeps
build_tools/strip_nonapi

index 474f5070cf58cabdedc5d12d3265a1d40f23bb72..f0b1f114496b91fcb095c48913d47cfe0337d9d1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -58,6 +58,8 @@ export PROC
 export SOLINK
 export STRIP
 export DOWNLOAD
+export GREP
+export ID
 export OSARCH
 export CURSES_DIR
 export NCURSES_DIR
index 167785340e9c8ac4b0e7b168356f8c127469a9e4..b7dadfc33840bd71b5d3ba8b1cd46990891c56f4 100755 (executable)
@@ -3,11 +3,7 @@ HOSTNAME=`uname -n`
 KERNEL=`uname -r`
 MACHINE=`uname -m`
 OS=`uname -s`
-if [ `uname -s` = "SunOS" ]; then
-  USER=`/usr/xpg4/bin/id -un`
-else
-  USER=`id -un`
-fi
+USER=`${ID} -un`
 DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
 cat << END
 /*
index 6993e708318cc834632ea202e5276bed07e5af35..ac41a006a4eb9feb001ea6f9bc7b4613943cab93 100755 (executable)
@@ -7,11 +7,11 @@ cat << END
  */
 
 END
-TMP=`grep MENUSELECT_CFLAGS menuselect.makeopts | sed 's/MENUSELECT_CFLAGS\=//g' | sed 's/-D//g'`
+TMP=`${GREP} MENUSELECT_CFLAGS menuselect.makeopts | sed 's/MENUSELECT_CFLAGS\=//g' | sed 's/-D//g'`
 for x in ${TMP}; do
      echo "#define ${x} 1"
 done
-if grep AST_DEVMODE makeopts | grep -q yes
+if ${GREP} AST_DEVMODE makeopts | ${GREP} -q yes
 then
        echo "#define AST_DEVMODE 1"
 fi
index f36c380a94c2e5d2e70c159e7a3b9a6f140a278e..ceea7ebc01d3854a5ae49424b546553cdfbd07cf 100755 (executable)
@@ -14,7 +14,7 @@ if [ ! -d $PPATH ]; then
 fi
 
 #Solaris (and some others) don't have sed -r.  perl -p is equivalent
-if [[ `echo "xxx" | sed -r 's/x/y/g' 2>/dev/null | grep -c "yyy"` != 0 ]]; then
+if [[ `echo "xxx" | sed -r 's/x/y/g' 2>/dev/null | ${GREP} -c "yyy"` != 0 ]]; then
     EXTREGEX="sed -r -e"
 else
     EXTREGEX="perl -pe"
index 01aeda6b7022522cbc73c3f04086f42002ad067f..333e8853e8e5c6e99be71fdd3447891c952852cf 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 get_description() {
-       TDESC=`grep -e AST_MODULE_INFO ${1} | head -n 1 | cut -d '"' -f 2`
+       TDESC=`${GREP} -e AST_MODULE_INFO ${1} | head -n 1 | cut -d '"' -f 2`
 }
 
 process_dir() {
index 5fc0ed1146f74f27f4fa3d69092b2ebe4b572d0f..c2262cafacd02e8ff4880ed4c6e92485f95acca4 100755 (executable)
 #      astman_
 #      pbx_
 
-FILTER="grep -v -e ^ast_ -e ^_ast_ -e ^__ast_ -e ^astman_ -e ^pbx_"
+FILTER="${GREP} -v -e ^ast_ -e ^_ast_ -e ^__ast_ -e ^astman_ -e ^pbx_"
 
 case "${OSARCH}" in
     linux-gnu)
-       nm ${1} | grep -e " T " | cut -d" " -f3 | ${FILTER} > striplist
+       nm ${1} | ${GREP} -e " T " | cut -d" " -f3 | ${FILTER} > striplist
        sed -e "s/^/-N /" striplist | xargs ${STRIP} ${1}
        rm -f striplist
        ;;