aboutsummaryrefslogtreecommitdiffstats
path: root/build_tools
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-24 22:17:12 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-24 22:17:12 +0000
commit6cea97bf72362558a8701e97d3f2ef0216cd2bb1 (patch)
tree16742b1c392207bbc49212b6db5bf31b93f03ac3 /build_tools
parent5b2b0761872b5f7bf64a8458cd1e57957c73a00d (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41015 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/mkpkgconfig17
1 files changed, 12 insertions, 5 deletions
diff --git a/build_tools/mkpkgconfig b/build_tools/mkpkgconfig
index bc04f7561..f36c380a9 100755
--- a/build_tools/mkpkgconfig
+++ b/build_tools/mkpkgconfig
@@ -13,13 +13,20 @@ 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/[[: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