From 53d9aa13eb953e122e610f8a85baa1a257b13faf Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Thu, 11 Nov 2004 14:48:53 +0000 Subject: [PATCH] Add pkgconfig support (bug #2734) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4201 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- Makefile | 1 + mkpkgconfig | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 mkpkgconfig diff --git a/Makefile b/Makefile index 3410888ddc..8fc73c3edc 100755 --- a/Makefile +++ b/Makefile @@ -314,6 +314,7 @@ clean: $(MAKE) -C stdtime clean datafiles: all + sh mkpkgconfig mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits for x in sounds/digits/*.gsm; do \ if grep -q "^%`basename $$x`%" sounds.txt; then \ diff --git a/mkpkgconfig b/mkpkgconfig new file mode 100755 index 0000000000..7b1b78f48d --- /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 < /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