[svn-commits] russell: branch 1.2 r60014 - /branches/1.2/mkpkgconfig

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Apr 3 16:00:10 MST 2007


Author: russell
Date: Tue Apr  3 18:00:10 2007
New Revision: 60014

URL: http://svn.digium.com/view/asterisk?view=rev&rev=60014
Log:
Use the more generic check for "sed -r" support that was already present in 1.4.
(related to issue #9399)

Modified:
    branches/1.2/mkpkgconfig

Modified: branches/1.2/mkpkgconfig
URL: http://svn.digium.com/view/asterisk/branches/1.2/mkpkgconfig?view=diff&rev=60014&r1=60013&r2=60014
==============================================================================
--- branches/1.2/mkpkgconfig (original)
+++ branches/1.2/mkpkgconfig Tue Apr  3 18:00:10 2007
@@ -7,27 +7,26 @@
   exit
 fi
 
-if uname -a | grep -q Darwin
-then
-  SEDARG=-E
-else
-  SEDARG=-r
-fi
-
 ## Create a pkgconfig spec file for 3rd party modules (pkg-config asterisk --cflags)
 
 if [ ! -d $PPATH ]; then
   exit
 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
+    EXTREGEX="sed -r -e"
+else
+    EXTREGEX="perl -pe"
+fi
+
 ## Clean out CFLAGS for the spec file.
 
-LOCAL_CFLAGS=`echo $CFLAGS | sed -e 's/\s*-pipe\s*//g' | sed -e 's/-[Wmp]\S*\s*//g' | \
-  sed $SEDARG -e 's/-I(include|\.\.\/include) //g' | \
-  sed -e 's/-DINSTALL_PREFIX=\S* //g' | \
-  sed $SEDARG -e 's/-DASTERISK_VERSION=\S* //g' | \
-  sed $SEDARG -e 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g'`
-
+LOCAL_CFLAGS=`echo $CFLAGS | ${EXTREGEX} 's/\s*-pipe\s*//g' | ${EXTREGEX} 's/-[Wmp]\S*\s*//g' | \
+  ${EXTREGEX} 's/-I(include|\.\.\/include) //g' | \
+  ${EXTREGEX} 's/-DINSTALL_PREFIX=\S* //g' | \
+  ${EXTREGEX} 's/-DASTERISK_VERSION=\S* //g' | \
+  ${EXTREGEX} 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g'`
 
 cat <<EOF > $PPATH/asterisk.pc
 install_prefix=$INSTALL_PREFIX



More information about the svn-commits mailing list