diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-16 15:51:43 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-16 15:51:43 +0000 |
commit | 52acc4c45786fc04da9536c2801eb2b483cc2009 (patch) | |
tree | 3e0b68760b7b6d49c72de4fd5b747ed4d5726ad3 /build_tools/mkpkgconfig | |
parent | 5d9d64e584ec5220835eb10a124b555d449fa3d3 (diff) | |
parent | caebf8461f9849f484eb5bbd649880e457c20e31 (diff) |
Creating tag for the release of asterisk-1.4.23-rc4
git-svn-id: http://svn.digium.com/svn/asterisk/tags/1.4.23-rc4@168755 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'build_tools/mkpkgconfig')
-rwxr-xr-x | build_tools/mkpkgconfig | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/build_tools/mkpkgconfig b/build_tools/mkpkgconfig new file mode 100755 index 000000000..ceea7ebc0 --- /dev/null +++ b/build_tools/mkpkgconfig @@ -0,0 +1,50 @@ +#!/bin/bash +PPATH=$1 +## Make sure we were called from Makefile + +if [ "x$ASTERISKVERSIONNUM" = "x" ]; then + echo " ** Do not call this script directly" + exit +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 | ${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 +version_number=$ASTERISKVERSIONNUM +etcdir=$ASTETCDIR +libdir=$ASTLIBDIR +varlibdir=$ASTVARLIBDIR +varrundir=$ASTVARRUNDIR +spooldir=$ASTSPOOLDIR +logdir=$ASTLOGDIR +confpath=$ASTCONFPATH +moddir=$MODULES_DIR +agidir=$AGI_DIR + +Name: asterisk +Description: Open Source PBX and telephony toolkit +Version: $ASTERISKVERSION +Libs: $LIBS +Cflags: $LOCAL_CFLAGS +EOF |