aboutsummaryrefslogtreecommitdiffstats
path: root/mkpkgconfig
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-11 14:48:53 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-11 14:48:53 +0000
commitd4903ea2f80ecd8f01db5fe188504d14acc86cac (patch)
tree1a124e11785d2c244b961852975bda07b8988508 /mkpkgconfig
parent0ba8d829ca6ec3e836327e4e2c0f15ee5a78fffa (diff)
Add pkgconfig support (bug #2734)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4201 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'mkpkgconfig')
-rwxr-xr-xmkpkgconfig43
1 files changed, 43 insertions, 0 deletions
diff --git a/mkpkgconfig b/mkpkgconfig
new file mode 100755
index 000000000..7b1b78f48
--- /dev/null
+++ b/mkpkgconfig
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+## 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 /usr/lib/pkgconfig ]; then
+ exit
+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 -r -e 's/-I(include|\.\.\/include) //g' |
+ sed -e 's/-DINSTALL_PREFIX=\S* //g' |
+ sed -r -e 's/-DASTERISK_VERSION=\S* //g' |
+ sed -r -e 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g'
+)
+
+cat <<EOF > /usr/lib/pkgconfig/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