[asterisk-commits] qwell: trunk r41015 - /trunk/build_tools/mkpkgconfig

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Aug 24 15:17:12 MST 2006


Author: qwell
Date: Thu Aug 24 17:17:12 2006
New Revision: 41015

URL: http://svn.digium.com/view/asterisk?rev=41015&view=rev
Log:
As per the comments in this file..
The last patch was slightly wrong.  This'll get it for sure.

Solaris (and some others) don't have sed -r.  perl -p is equivalent

Modified:
    trunk/build_tools/mkpkgconfig

Modified: trunk/build_tools/mkpkgconfig
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/mkpkgconfig?rev=41015&r1=41014&r2=41015&view=diff
==============================================================================
--- trunk/build_tools/mkpkgconfig (original)
+++ trunk/build_tools/mkpkgconfig Thu Aug 24 17:17:12 2006
@@ -13,13 +13,20 @@
   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/[[:space:]]*-pipe[[:space:]]*//g' | sed -e 's/-[Wmp][^[:space:]]*[[:space:]]*//g' | \
-  sed -e 's/-I\(include|\.\.\/include\) //g' | \
-  sed -e 's/-DINSTALL_PREFIX=[^[:space:]]* //g' | \
-  sed -e 's/-DASTERISK_VERSION=[^[:space:]]* //g' | \
-  sed -e 's/-DAST\(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR\)=[^[:space:]]* //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



More information about the asterisk-commits mailing list