2009-09-24 08:36:18 +00:00
|
|
|
#!/bin/sh
|
2011-08-25 15:30:46 +00:00
|
|
|
PPATH="$1"
|
2004-11-11 14:48:53 +00:00
|
|
|
## Make sure we were called from Makefile
|
|
|
|
|
2004-12-14 23:36:30 +00:00
|
|
|
if [ "x$ASTERISKVERSIONNUM" = "x" ]; then
|
2004-11-11 14:48:53 +00:00
|
|
|
echo " ** Do not call this script directly"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
## Create a pkgconfig spec file for 3rd party modules (pkg-config asterisk --cflags)
|
|
|
|
|
2011-08-25 15:30:46 +00:00
|
|
|
if [ ! -d "$PPATH" ]; then
|
2004-11-11 14:48:53 +00:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2006-08-24 22:17:12 +00:00
|
|
|
#Solaris (and some others) don't have sed -r. perl -p is equivalent
|
2009-09-24 14:44:08 +00:00
|
|
|
if [ `echo "xxx" | sed -r 's/x/y/g' 2>/dev/null | ${GREP} -c "yyy"` != 0 ]; then
|
2006-08-24 22:17:12 +00:00
|
|
|
EXTREGEX="sed -r -e"
|
|
|
|
else
|
|
|
|
EXTREGEX="perl -pe"
|
|
|
|
fi
|
|
|
|
|
2004-11-11 14:48:53 +00:00
|
|
|
## Clean out CFLAGS for the spec file.
|
|
|
|
|
2006-08-24 22:17:12 +00:00
|
|
|
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'`
|
2005-03-17 23:12:15 +00:00
|
|
|
|
2004-11-11 14:48:53 +00:00
|
|
|
|
2011-08-25 15:30:46 +00:00
|
|
|
cat <<EOF > "$PPATH/asterisk.pc"
|
2004-11-11 14:48:53 +00:00
|
|
|
install_prefix=$INSTALL_PREFIX
|
|
|
|
version_number=$ASTERISKVERSIONNUM
|
|
|
|
etcdir=$ASTETCDIR
|
|
|
|
libdir=$ASTLIBDIR
|
|
|
|
varlibdir=$ASTVARLIBDIR
|
|
|
|
varrundir=$ASTVARRUNDIR
|
|
|
|
spooldir=$ASTSPOOLDIR
|
|
|
|
logdir=$ASTLOGDIR
|
|
|
|
confpath=$ASTCONFPATH
|
2012-01-30 21:21:16 +00:00
|
|
|
moddir=$ASTMODDIR
|
2004-11-11 14:48:53 +00:00
|
|
|
agidir=$AGI_DIR
|
|
|
|
|
|
|
|
Name: asterisk
|
|
|
|
Description: Open Source PBX and telephony toolkit
|
|
|
|
Version: $ASTERISKVERSION
|
|
|
|
Libs: $LIBS
|
|
|
|
Cflags: $LOCAL_CFLAGS
|
|
|
|
EOF
|