diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-03 23:00:10 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-03 23:00:10 +0000 |
commit | 0c5d33d0265227860fc6594a61c73a0f1e8608cf (patch) | |
tree | 6f34d32a3e9c542ba9ca21bdda33f0b0b89159b1 /mkpkgconfig | |
parent | 98b1c68e69a994d96fa6a7a0b8a596a6c640fa8f (diff) |
Use the more generic check for "sed -r" support that was already present in 1.4.
(related to issue #9399)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@60014 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'mkpkgconfig')
-rwxr-xr-x | mkpkgconfig | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/mkpkgconfig b/mkpkgconfig index 1897e3ce5..81927d76a 100755 --- a/mkpkgconfig +++ b/mkpkgconfig @@ -7,27 +7,26 @@ if [ "x$ASTERISKVERSIONNUM" = "x" ]; then 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 -## Clean out CFLAGS for the spec file. +#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 -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'` +## Clean out CFLAGS for the spec file. +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 |